3.6 Popcorn and Homework Hacks
Mihir's Submission for Hacks from Lesson
Homework Hacks
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.
# Take two numbers as input from the user
num1 = float(input("Enter the first number: "))
num2 = float(input("Enter the second number: "))
# Determine if the numbers are equal
if num1 == num2:
print("The numbers are equal.")
else:
# Print which number is larger
if num1 > num2:
print(f"The first number {num1} is larger.")
else:
print(f"The second number {num2} is larger.")
The first number 0.8 is larger.