-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathage validator.py
More file actions
73 lines (59 loc) · 2.42 KB
/
Copy pathage validator.py
File metadata and controls
73 lines (59 loc) · 2.42 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# building an age validator for people
# not older than 120 years
print("\t\t--------------------------------\t\t\t")
print("\t\t--------------------------------\t\t\t")
print()
print("\t\t\tWELCOME TO CHIJULY AGE VALIDATOR☺️")
print()
print("\t\t--------------------------------\t\t\t")
print("\t\t--------------------------------\t\t\t")
print("Your name: ") #user's name
name = input(" ")
print()
print("login password:")
password = input(" ") #user's password must have numbers, block and small letters in it
# Password validation program
# Initialize checks
has_upper = False
has_lower = False
has_digit = False
# Check each character in the password
for char in password:
if char.isupper():
has_upper = True
elif char.islower():
has_lower = True
elif char.isdigit():
has_digit = True
# Final validation
if has_upper and has_lower and has_digit:
print("Access granted ✅ Password strength acceptable!")
print()
print("Enter your birth year: ")
age = int(input(" "))
if age >= 1582:
if age > 1895:
print("Congratulations! You have been verified✅")
print()
# the user's age is calculated
print("Now let's calculate your current age.")
print("Enter\"yes\" to proceed:")
proceed = input(" ")
#the user was born in the Gregorian calendar and is still abovve 65 years old
if proceed.lower() == "yes":
if 1895 < age < 1960:
print("Woww....You are currently", 2025 - age, "years old, and a kicking elder☺️")
#final warm greetings
print("\t\t\t----------------------------")
print("\t\t\t----------------------------")
print()
print("\t\t\tTHANK YOU FOR USING CHIJULY AGE VALIDATOR")
print()
print("\t\t\t----------------------------")
print("\t\t\t----------------------------")
else:
print("Congratulations! Your age is verified✅")
else:
print("You appear to be in the Gregorian era, but not valid forr registeration❌")
else:
print("Access denied ❌ Password must contain at least one uppercase letter, one lowercase letter, and one number.")