-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathPassword Program.py
More file actions
29 lines (21 loc) · 876 Bytes
/
Password Program.py
File metadata and controls
29 lines (21 loc) · 876 Bytes
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
# Create this fun Password Python program example below.
# Created by Joseph C. Richardson, GitHub.com
message_text = 'Please type your password to enter: '
password = 'open sesame'
welcome = "Welcome!\n\nYou've gained access into HEXADECACOM A.I."
incorrect_password = 'PASSWORD INCORRECT!'
denied_entry = 'You have entered the incorrect password too many times.\n\nAccess Denied!'
end_program = 'Now you know how to make Python create a password, that only you know.'
line_break = '\n'
count = 1
while count <= 3:
message = input(message_text)
if message == password:
print(line_break+welcome+line_break) # This is where you would put all your nice, complex Python code
break
else:
print(line_break+incorrect_password+line_break)
count += 1
if count == 4:
print(denied_entry+line_break)
print(end_program)