-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnameandcity.py
More file actions
20 lines (17 loc) · 842 Bytes
/
nameandcity.py
File metadata and controls
20 lines (17 loc) · 842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#program that allows user to input name and birthplace
#ensures that birthplace is correct
#6/23/2020
first_name = input("What is your name? ")
home = input(first_name + " where were you born?(City and State) ")
answer_yes = "yes"
answer_no = "no"
answer = input(first_name + " are you from " + home + "? ")
if answer.lower() == answer_yes.lower(): #lowercase function converts upper to lowercase
print(first_name + " you were born in " + home)
elif answer.lower() == answer_no.lower():
home_correct = input(first_name+ " please enter your correct birthplace ")
answer_new = input(first_name + " were you born in " + home_correct + "? ")
if answer_new.lower() == answer_yes.lower():
print("\n"+first_name + " you were born in " + home_correct)
else:
print("\nPlease restart your application")