【发布时间】:2020-06-14 11:38:54
【问题描述】:
我正在尝试编写一个迷你代码来检查用户/键输入是否正确,代码是下一个:
if emailstatus == True and email in UserKeys == True and UserKeys [email] == key :
print ('Checked, you can log in ')
else:
print ('wrong email or password, you can not log in')
'''
当我输入正确的电子邮件和密码时,我仍然无法登录(这会生成三个 True 值
我已修复此问题,将“()”添加到 ( 用户密钥中的电子邮件 )中的 if 条件 == True
但我还是不明白这个错误背后的逻辑
pd:完整的程序代码是这样的
【问题讨论】:
-
在问题中添加minimal reproducible example,作为文本。
标签: python email if-statement logic