Created
April 28, 2020 12:41
-
-
Save vereperrot/2602a70bd32464b4e62e1d38ac807dbb to your computer and use it in GitHub Desktop.
print_full_name.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_formatted_name(first_name,last_name): | |
"""return full name""" | |
full_name=first_name+' '+last_name | |
return full_name.title() | |
def print_full_name(): | |
while True: | |
print("\nPlease tell me your name:") | |
print("(enter 'q' at any time to quit)") | |
f_name=input("First name:") | |
if f_name=='q': | |
break | |
l_name=input("Last name:") | |
if l_name=='q': | |
break | |
formatted_name=get_formatted_name(f_name,l_name) | |
print("\nHello, "+formatted_name+"!") | |
print_full_name() | |
""" | |
OUTPUT: | |
Please tell me your name: | |
(enter 'q' at any time to quit) | |
First name:hello | |
Last name:world | |
Hello, Hello World! | |
""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment