-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUser Validation.py
More file actions
40 lines (31 loc) · 1.5 KB
/
Copy pathUser Validation.py
File metadata and controls
40 lines (31 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from random import choice
from string import ascii_letters
print("Welcome to XXX User Registration Portal! Please enter the following details to set up your account.")
firstName = input("Please enter your first name: ")
lastName = input("Please enter your last name: ")
emailId = input("Please enter your email address: ")
EmployeeDetails = [firstName, lastName, emailId]
print(EmployeeDetails)
apass = firstName[:2] + lastName[-2:] + "".join(choice(ascii_letters) for x in range(5))
print("Based on our password suggestion algorithm, your password is {apass}")
satisfied = input("Do you like the suggested password? Type Y/N.")
if satisfied.upper == "Y":
print ("Registration successful. Thanks for registering! Your password is:", apass)
break
elif satisfied.upper == "N":
new_password = input("Please, enter a password that is at least 7 characters long.")
while len(new_password) < 7:
new_password = input("Please, enter a password that is at least 7 characters long.")
else:
apass = new_password
print("Password accepted and registration is successful. Thanks for registering! Your password is {apass}")
break
elif user_password
lastUser = input("Are you the last user? Type y/n.")
EmployeeRecords ={
'First name': firstName,
'Last name': lastName,
'Email address': emailId
}
list = [EmployeeRecords]
print(list)