Quick actions

cmd+k|ctrl+k

Navigation

Languages

whileloop_why cannot input(100)

Snippet info

Language

Python

Visibility

public

Author

taimanchan1217

Created

2026-04-18T10:03:34.300855Z

Updated

2026-04-20T13:43:42.689305Z

#why cannot input(100)

  
print("Use a while loop to keep asking the user for a number until they enter a number bigger than 100.")

while True:                     # This means "loop forever until we break"
    number = int(input("Keep entering numbers until you enter a number bigger than 100."))
    
    if number > 100:
        print(f"Congrats!{number} is bigger than 100.")
        break
    else:
        print(f"Your number is {number}. Please try again.")
        
INFO