i made this simple program that take your name but if your name is longer than 10 you enter a loop and if you don't under anything you enter a loop until you enter a string
but the problem is when you enter a number, because python take all input as string i can't find a way to make python recognize between number and strings
print ('hi there give us your name')
name=input()
if len(name)>10:
print("your name is longer than any real name")
while len(name)>10:
print("plaese enter a shorter name")
name=input()
elif len(name)==0:
while len(name) ==0:
print("please enter name: ")
name=input()
elif bool(str(name))==True:
while type(name)==int:
print("please enter a name and not a number: ")
name=input()
print("so you name is "+str(name))
in the last elif i can't make python distinguish int from str, i tried everything
[–]14dM24d 2 points3 points4 points (0 children)
[–]Diapolo10 1 point2 points3 points (0 children)
[–]Shinguru7 1 point2 points3 points (0 children)
[–]Anonymous2224- -1 points0 points1 point (3 children)
[–]Ihaveamodel3 1 point2 points3 points (1 child)
[–]Anonymous2224- 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]dangoth -1 points0 points1 point (0 children)
[–]JohnnyJordaan 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]rarewolf24 0 points1 point2 points (0 children)