Created
April 28, 2020 12:39
-
-
Save vereperrot/0d005d36ed2e3a41644186be6d90eb31 to your computer and use it in GitHub Desktop.
build_person.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 build_person(first_name,last_name,age=''): | |
"""return a dictionary, its about a person's information""" | |
person={'first':first_name,'last':last_name} | |
if age: | |
person['age']=age | |
return person | |
musician=build_person('jimi','hendrix',age=27) | |
print(musician) | |
""" | |
OUTPUT: | |
{'first': 'jimi', 'last': 'hendrix', 'age': 27} | |
""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment