17 lines
616 B
Plaintext
17 lines
616 B
Plaintext
fun compare(a, b):
|
|
print("\n$a is of type ${typeof(a)} and $b is of type ${typeof(b)}")
|
|
if a < b: print("$a is strictly less than $b")
|
|
if a <= b: print("$a is less than or equal to $b")
|
|
if a > b: print("$a is strictly greater than $b")
|
|
if a >= b: print("$a is greater than or equal to $b")
|
|
if a == b: print("$a is equal to $b")
|
|
if a != b: print("$a is not equal to $b")
|
|
if a is b: print("$a has object identity with $b")
|
|
if a is not b: print("$a has negated object identity with $b")
|
|
|
|
compare("YUP", "YUP")
|
|
compare('a', 'z')
|
|
compare("24", "123")
|
|
compare(24, 123)
|
|
compare(5.0, 5)
|