Skip to content

Instantly share code, notes, and snippets.

@vereperrot
Created April 28, 2020 12:39
Show Gist options
  • Save vereperrot/0d005d36ed2e3a41644186be6d90eb31 to your computer and use it in GitHub Desktop.
Save vereperrot/0d005d36ed2e3a41644186be6d90eb31 to your computer and use it in GitHub Desktop.
build_person.py
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