Answer:
Step-by-step explanation:
I will be using Python 3 syntax in writing the code.
- First we need to define a Function 'compare_number' that parse in 2 variables x and y to be compared.
- Then we use the conditional statement if/else to check for the conditions.
- Finally, we will return a Boolean operator True/False or rather print out the statement result to the console. The code is as shown below.
def compare_numbers (x, y):
if x <= y:
return True
else:
return False
compare_number (2,3)
Since 2 is less than 3, the result that will be displayed on the console will be True.