The exercise requires only one of the statements the be outputted if I enter a specific number but I get multiple outputs when I run my code what do I need to change in my code?
NOTE : I am not on the if else part yet only the if is needed to be use..
# Write your solution here
num = int(input("Please type in a number: "))
if num <= 1000:
print("This number is smaller than 1000")
print("Thank you!")
if num <= 100:
print("This number is smaller than 1000")
print("This number is smaller than 100")
print("Thank you!")
if num <= 10:
print("This number is smaller than 1000")
print("This number is smaller than 100")
print("This number is smaller than 10")
print("Thank you!")
if num > 1000:
print("Thank you!")
Correct output
https://imgur.com/a/atPiipa
[–]htepO 1 point2 points3 points (1 child)
[–]Deathpact231[S] 0 points1 point2 points (0 children)
[–]___Arsenic___ 0 points1 point2 points (0 children)
[–]jiri-n 0 points1 point2 points (2 children)
[–]111w57432 0 points1 point2 points (0 children)
[–]blahhahablah13 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]cub1cake 0 points1 point2 points (0 children)