题解 | #验证登录名与密码#
验证登录名与密码
https://www.nowcoder.com/practice/f3517fb21fd34d3880bd41454ca7209f
admin = {"admis": "Nowcoder666"} name = input() password = input() if admin.get(name) == password: print("Welcome!") else: print("user id or password is not correct!")##使用get方法获取字典键值,当键不存在时不会抛出异常,而是返回None,后续程序继续运行