0
number_1 = int(input("enter a number below 10: "))
if number_1 > 10:
    print ("its over 10 start again.")
else:
    print ("Okay lets get started")

how do i make it so that when a number higher than 10 is input it repeats the question. untill the person does something under 10

azro
  • 53,056
  • 7
  • 34
  • 70

2 Answers2

0

Use a while loop around input

number_1 = int(input("enter a number below 10: "))
while number_1 > 10:
    number_1 = int(input("its over 10 start again, enter a number below 10: "))
print("Okay lets get started")

Could be written another way

while True:
    number_1 = int(input("Enter a number below 10: "))
    if number_1 <= 10:
        print("Okay lets get started")
        break
azro
  • 53,056
  • 7
  • 34
  • 70
0
while True:
    number_1 = int(input("enter a number below 10: "))
    while number_1 > 10:
        print ("its over 10 start again.")
        break
    if number_1 < 10:
        print ("Okay lets get started")
        break

This loops the input until the number is below 10 and once it is below 10 it breaks. Hope this is what you wanted

LowkeyCode
  • 21
  • 4