dimanche 29 décembre 2019

Hi I need to write a function that receives an integer from the user and validates that it’s larger than 10 If not, ask for it again [duplicate]

This question already has an answer here:

I need to write a function that receives an integer from the user and validates that it’s larger than 10 If not, ask for it again. I need to do this using loop and python. The code works if I enter a number bigger than then but it does not reiterate the question if I write a number smaller than 10

Number = int(input("Please enter a number larger than 10: "))
while (Number < 10):
    print("Please enter a number larger than 10")
    exit()
else:
    print("Thank you")

Aucun commentaire:

Enregistrer un commentaire