#Mastery29
#TC1014
This is very useful since it helps to make a good and clean code without too many errors to fix, for example:
while True:
try:
q=int(input(“Please enter a non-negative integer number: “))
break
except ValueError:
print(“this is not a integer number, try again: “)
while q
try:
q=int(input(“this is not a positive number,try again: “))
except ValueError:
print (“this is not a integer number, try again: “)
while True:
try:
q=int(input(“Please enter a non-negative integer number: “))
break
except ValueError:
print (“this is not a integer number, try again: “)
Validated user input in Python by Jorge Padilla is licensed under a Creative Commons Attribution 4.0 International License.