28 lines
619 B
Plaintext
28 lines
619 B
Plaintext
def compare(a, b)
|
|
println format("\n%s is of type %s and %s is of type %s", a, type(a), b, type(b))
|
|
if a < b
|
|
println format("%s is strictly less than %s", a, b)
|
|
end
|
|
if a <= b
|
|
println format("%s is less than or equal to %s", a, b)
|
|
end
|
|
if a > b
|
|
println format("%s is strictly greater than %s", a, b)
|
|
end
|
|
if a >= b
|
|
println format("%s is greater than or equal to %s", a, b)
|
|
end
|
|
if a = b
|
|
println format("%s is equal to %s", a, b)
|
|
end
|
|
if a != b
|
|
println format("%s is not equal to %s", a, b)
|
|
end
|
|
end
|
|
|
|
compare("YUP", "YUP")
|
|
compare("BALL", "BELL")
|
|
compare("24", "123")
|
|
compare(24, 123)
|
|
compare(5.0, 5)
|