去掉两端的空格 strip user = input("username:").strip() pwd = input("password:").strip() if user == 'alex' and pwd == "alexdsb": print("登录成功!") else: print("账号或密码错误!") pwd = " alexdsb " a = pwd.strip() # 脱 默认脱(脱头尾两端的空格,换行符\n,制表符\t) prin...