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
1 Resposta
+ 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)