(1)#if 语句 验证用户名和密码user = 'Zhaoxiaoxue'
password = '123456'
username = ''
passnumber = ''
while user != username or password != passnumber :
username = input("Please enter username: ")
passnumber = input("Please enter password: ")
if user == username and password == passnumber :
print('Welcome,%s!' % username)
break
else :
print("username or password is invalid!")
(2)#while、for循环
'''
#while 循环顺序输出0~99 验证break
count=0
while True:
print("count: ",count)
count+=1
if count==100:
break
'''
'''
#for循环 验证continue
for i in range(0,10):
if i<5 :
print('loop ',i)
elif i==5 :
print("loop :",i)
else :
continue
print("hello!")
'''
#嵌套for循环
for i in range(1,11) :
print ("*********",i)
for j in range(10) :
print (j)
if j==4 :
break