标签:用户 if语句 int login 是否一致 输入 字符 div size
1. 判断输入的字符是否一致
SIZE="hello" char=input("输入字符名称:") if char == SIZE: print("字符名称%s"%char,"等于",SIZE) else: print("请输入字符",SIZE)
2.判断登录验证用户名密码
user="desperado" pwd="123456" username=input("用户名:") password=input("密码:") if username == user and password == pwd: print("login successful ...") elif username != user: print("the user does not exist") else: print("login fail")
标签:用户 if语句 int login 是否一致 输入 字符 div size
原文地址:http://www.cnblogs.com/shansongxian/p/6029816.html