问题:用input输入密码,正确通过,错误重输,有3次机会。
python代码如下:
count = 0
password = 123456
while count < 3:
inp = int(input('input password'))
if inp == password:
print('correct!!')
break
else:
print('wrong! you son of a bitch.')
count = count + 1
if count == 3:
print('get the fuck out of here!!!')