Skip to the content.
3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 3.10 JS for Loops and Sprites

Big Idea 3.6 Hacks

We learned about using if and else loops help control the flow of a program, and to execut specific code under specific conditions.

#Write a Python program that takes two numbers as input from the user. The program should: Determine if the numbers are equal, If the numbers are different, print which number is larger.
num1 = int(input("Please input a number: "))
num2 = int(input("Please input another number: "))
if num1 == num2:
    print("They are equal")
else:
    if num1 >= num2:
        print(num1, "is larger.")
    else:
        print(num2, "is larger.")