课后题9 的问题,求指导
课后题9 : 了不起的分支动动手 第0题, 自己写了代码,在标黄这一行显示有语法错误, 死活找不到啊。。。。各位老大,可以求指点一把吗?
count = 3
password = 'fish'
while count:
passwd = input('请输入密码:')
if passwd ==password:
print ('Right, continue please...')
break
elif '*' in passwd:
print ('con\'t includ '*', you only have', count, 'times', end=' ')
continue
else:
print ('wrong password, you have', count-1, 'times', end' ')
count-=1
谢谢老大! 本帖最后由 zltzlt 于 2019-12-28 16:44 编辑
少了一个 =。
count = 3
password = 'fish'
while count:
passwd = input('请输入密码:')
if passwd == password:
print('Right, continue please...')
break
elif '*' in passwd:
print("con't include '*', you only have", count, 'times', end=' ')
continue
else:
print('wrong password, you have', count - 1, 'times', end=' ')
count -= 1 zltzlt 发表于 2019-12-28 16:42
少了一个 =。
谢谢 Zltzlt!太感动了!
页:
[1]