Curso_Intensivo_de_PYTHON/chapter_08/person.py
2023-06-02 17:22:53 +02:00

9 lines
292 B
Python

def build_person(first_name, last_name, age=None):
"""Return a dictionary of information about a person."""
person = {'first': first_name, 'last': last_name}
if age:
person['age'] = age
return person
musician = build_person('jimi', 'hendrix', age=27)
print(musician)