设计密码验证程序,三次机会,如果包含*号的话不计算在内。
count =3
password = 'OstrovskyWzp'
while count:
temp = input("please input password:")
if password == temp:
print("right")
break;
elif '*' in temp:
print("not * in password,you have ",count,"times!",end = ' ')
continue;
else:
print("wrong password!you have",count-1,"times!",end= ' ')
count-=1