I have to make a Landmark Credit Union in their online banking department.
(我必须在其网上银行部门中建立一个Landmark信用合作社。)
And so I'm trying to create a username and password verification/ creation program for the online service. (因此,我正在尝试为在线服务创建用户名和密码验证/创建程序。)
Here is the problem:
(这是问题所在:)
When choosing a username and password, a client must enter a valid email address for their username (must contain an “@” symbol, must contain a “.”, and must contain a “.com” or “.edu”).
(在选择用户名和密码时,客户端必须为其用户名输入有效的电子邮件地址(必须包含“ @”符号,必须包含“。”,并且必须包含“ .com”或“ .edu”)。)
When choosing a valid password, the client must have ALL of the following: At least one (1) capital letter, be at least nine (9) characters long, and must contain one (1) special character.
(选择有效的密码时,客户端必须具有以下所有内容:至少一(1)个大写字母,至少九(9)个字符,并且必须包含一(1)个特殊字符。)
If a client enters an incorrect username, the program must respond with an appropriate message asking them to try again.
(如果客户端输入了错误的用户名,则程序必须以适当的消息作为响应,要求他们重试。)
If a client enters an incorrect password, the program must respond with an appropriate message asking them to try again. (如果客户端输入了错误的密码,则程序必须以适当的消息作为响应,要求他们重试。)
Make a list of two usernames and passwords as an example of stored data that cannot be replicated, as they already belong to another client.
(列出两个用户名和密码,作为无法复制的存储数据的示例,因为它们已经属于另一个客户端。)
But I am having trouble containing the must-haves.
(但是我在包含必需品方面遇到了麻烦。)
File > Username.txt 'r' is:
(文件> Username.txt'r'为:)
Username 1 > CaptainMarvel25, Password 1 > AnythingisPossible25
Username 2 > Thor7, Password 2 > AllMightyThor7
but when I type the username it says define CaptainMarvel25.
(但是当我输入用户名时,它说定义CaptainMarvel25。)
help (救命)
import csv
def main():
with open("Usernames.txt","r") as file:
file_reader = csv.reader(file)
user_find(file_reader)
file.close()
def user_find(file):
user = input("Enter your username: ")
for row in file:
if row[0] == user:
print("username found", user)
user_found = [row[0],row[1]]
pass_check(user_found)
break
else:
print("not found")
def pass_check(user_found):
user = input("enter your password: ")
if user_found[1] == user:
print("password match")
else:
print("password not match")
user_find(file_reader)
main()
ask by KitKat G translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…