1.输入账号密码,判断成功,程序退出。判断失败,继续登录输入。
考察点:while和if语句的运用,及flage标志位。
#coding=utf-8; flage = True; while flage: user = raw_input("用户名:"); print user; pwd = input("密码:"); print pwd; if user == "tom" and pwd ==123: print "登录成功"; flage = False; else: print "登录失败";
标签:练习题,flage,登录,python,pwd,user,print,input From: https://www.cnblogs.com/joyware/p/16731867.html