Skip to content

Commit d1a5d2e

Browse files
Solution for secret password challenge given in class
1 parent 3e85b02 commit d1a5d2e

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

secretPasswordSolution

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Create a program that:
2+
# Takes a user's input
3+
# checks if his input is equal to your secret password
4+
# prints if the user guessed the password correctly or not
5+
# do not end the program if the user guesses incorrectly,
6+
# ask him again until he guesses the correct password
7+
8+
print('Start')
9+
while(True):
10+
#INFINITE
11+
print('Enter in your password')
12+
usrinput = input()
13+
mySecretPassword = 'your password'
14+
if(usrinput == mySecretPassword):
15+
break
16+
else:
17+
print("That's not right!")
18+
#INFINITE
19+
20+
print('You guessed my secret password!')
21+
print('End')

0 commit comments

Comments
 (0)