summaryrefslogtreecommitdiff
path: root/projects/2/prog3.py
blob: 9b1bd6bbabad2bd29eba78b241450c051bbd8660 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env python

# This program requests a password, and then asks the user for their name.

print("""
Program author: mo khan
ID: 3431709
Program 3-LOOPS AND IF CONDITIONS
""")

while input("Password? ") != 'hello':
    print()

print('Welcome to the second half of the program!')
name = input("What is your name? ")
if name == 'mo':
    print("What a great name!")
elif name == 'Madonna' or name == 'Cher':
    print("May I have your autograph, please?")
else:
    print("{}, that's a nice name".format(name))