cshw/py/MoreIfStatements/challenge1.py

21 lines
500 B
Python

# Ask the user to enter a number
num1 = int(input("Enter a number: "))
# Check if the first number is 5
if num1 == 5:
print("You win")
else:
# If the first number is greater than 5
if num1 > 5:
print("Too high, try again")
else:
print("Too low, try again")
# Ask the user to enter another number
num2 = int(input("Enter another number: "))
# Check if the second number is 5
if num2 == 5:
print("You win")
else:
print("You lose")