Python Number Comparison: Check Which Number is Bigger

num1 = 10
num2 = 20

if num1 < num2:
    print("num1 is less than num2")
elif num1 > num2:
    print("num1 is greater than num2")
else:
    print("num1 is equal to num2")

This code starts by defining two numbers, num1 and num2, and then uses an if statement to determine the relationship between num1 and num2. It then prints out the corresponding information based on the result of the comparison.

bannerAds