我正在开发一个程序,该程序的行为类似于预先存在的用户名/密码字段。我要完成的工作是要求用户发送电子邮件
email = input("Enter the provided email:\n")
然后,我查看是否已有使用此电子邮件的帐户。问题是这是给Authy的。我想向用户询问电子邮件,并查看是否在Authy中已经有与此电子邮件相关联的帐户。
假设您将电子邮件列表保存在列表中,则可以执行以下操作:
correct_email = False
email_list = ['[email protected]','[email protected]','[email protected]','[email protected]','[email protected]']
while correct_email == False:
email = input("Enter the provided email:\n")
if email in email_list:
print('whatever you need here')
correct_email = True
else:
print('email already exists, please input a different email')