0

How i understand "raising errors"

suppose i want an user to input a name which consist of alphabets only. and the user enters numbers. here i can raise an error. thank u

15th Apr 2017, 7:07 PM
stephen haokip
stephen haokip - avatar
1 Odpowiedź
+ 1
Here, I wrote a function that checks for numbers and makes them re-enter their name def getName(): name=input("Enter Your Name ") for i in name: if i.isnumeric(): print("Error: No Numbers\n") getName() else: pass return name name=getName() print("Your name is "+name)
18th Apr 2017, 1:08 AM
LordHill
LordHill - avatar