菜鳥生活(python)之if判斷,pythonif
#! usr/bin/env python
#!-*-conding:utf-8-*-
#第一步:定義變量 name = 'python' passwd = 'password'
#第二步:寫while循環 定義count=0
#第三步:判斷count=3則打印print("Account Be Locked!!Please Change User")並跳出程序break
#第四步:用input模塊和用戶交互
#第五步:if判斷用戶輸入是否何定義變量的值相同,用戶名和密碼匹配則打印Welcome Login...並跳出程序break
#第六步:if判斷用戶輸入和定義用戶和密碼不匹配則循環三次退出程序
name = 'python'
passwd = 'password'
count = 0
while True:
if count == 3:
print("Account Be Locked!!Please Change User")
break
username =input("Please input your name :")
password =input("Please input your password:")
if username == name and password == passwd:
print("Welcome Login...")
break
else:
print("Login falied ,Please again Try...Thank you!")
count +=1