用户登录,代码pycharm如下:
count = 0 while count < 3: user = input(‘‘) pwd = input(‘‘) if user == ‘alex‘ and pwd == ‘1234‘: print(‘hello my gods‘) print(‘..............‘) break else: print(‘yours count or code is error!‘) count = count + 1
我在pycharm中写出这个代码的适合,首先遇到缩进错误,然后遇到if语句循环错误。
主要 注意python中严格的缩进问题。
然后 多练习各个数据结构的使用。
原文:https://www.cnblogs.com/lhai000/p/9350778.html