为什么python只选择第一个语句?

时间:2018-03-05 01:10:01

标签: python-3.x

print (' give me your name \n without any number ')
name=input('enter your name ')
print (name)
for i in name:
    if i == 1 or 2 or 3:
        print ('this name have number in it you failed ')
        print (i)       
    else:
        print ("you pass  ")

即使我输入的号码为1~3或者没有它会选择第一个语句为什么?

0 个答案:

没有答案