Validation

--Originally published at Hector Martinez Alcantara

A validation is when you request an specific type of value from the user, so, you have to force the user to type what you want.

Let’s do an example:

var=input("Type a number\n")
while str.isnumeric(var)== 0:
 var=input("That's not a number, please type a number\n")
print("%s is the number you typed"%(var))

First, you require a string from the user, if the string is not a number, the program will request the number again.

That’s the main idea of a validation, depends on you how many conditions you want in your validation.