标签:使用 -- input -o python erro error tom 条件
# 伊洛Yiluo
# https://yiluotalk.com/
>>> password = 123456
>>> input_password = int(input(‘Please input password to login: ‘))
Please input password to login: 654321
>>> if input_password == password:
... print(‘login successfully!‘)
... else:
... print(‘Password ERROR, Please Retry~‘)
...
Password ERROR, Please Retry~
>>> name_list = [‘Yiluo‘, ‘Tom‘, ‘Lucy‘, ‘Joe‘]
>>> for _ in name_list:
... print(_)
...
Yiluo
Tom
Lucy
Joe
>>> for i in range(8):
... print(i)
...
0
1
2
3
4
5
6
7
>>> a = 10
>>> while a >0:
... print(a)
... a -=1
...
10
9
8
7
6
5
4
3
2
1
>>> a = 10
>>> while a >0:
... if a == 3:
... break
... print(a)
... a -=1
...
10
9
8
7
6
5
4
a 等于 3的时候 break
# 公众号:伊洛的小屋
>>> for i in range(10):
... if i == 3:
... continue
... print(i)
...
0
1
2
4
5
6
7
8
9
i 等于3 的时候被忽略
标签:使用 -- input -o python erro error tom 条件
原文地址:https://www.cnblogs.com/yiluotalk/p/13552874.html