python - Not making integer inputs -
this question has answer here:
i want way user not make integer input using function:
x = input("whats name?") while x == int: y = input("why there number in name? please re enter name")
but not work. idea why?
improving in @persian_dev's answer -
def check_name(string): char in string : try: int(char) return false except: continue return true
this traverse string, try convert each character int , return false on first success in doing so.
Comments
Post a Comment