所以这是我到目前为止对我的调查问卷的编码。在第6行,如果用户输入一组不是1234的随机字符,如何使其打印无效?
print ("Welcome, Please enter your Canadian Armed Forces Identification Number")
answer = raw_input()
if answer == ("1234"):
print " Please identify yourself "
elif answer == "":
print " Invalid ID "
print " 3 More attempts before termination of program "
name= raw_input()
if answer == ("Silva"):
print " Welcome, Silva "
答案 0 :(得分:0)
if answer == ("1234"):
print " Please identify yourself "
else:
print " Invalid ID "
print " 3 More attempts before termination of program " name= raw_input()