Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #name1 = name of first person
- #name2 = name of second person
- #yon = yes or no
- #Printname function = asks name and prints greeting
- def Printname():
- name1 = raw_input ("What is your name?")
- name2 = raw_input ("What is your friend's name?")
- print "Hello!", name1
- print "Hello!", name2
- Rep()
- def Rep():
- rep = raw_input ("Would you like to do it again? Y or N")
- if rep == "Y":
- Printname()
- elif rep =="N":
- Nothx()
- else:
- Error()
- Rep()
- def Nothx():
- print "Okay, Goodbye!"
- def Error():
- print "You have pressed an incorrect key."
- yon = raw_input ("Would you and your friend like a greeting? Y or N")
- if yon == "Y":
- Printname()
- elif yon =="N":
- Nothx()
- else:
- print "You have entered an incorrect key"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement