Skip to content

Latest commit

 

History

History
 
 

12.4-Map_list_of_objects

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

12.4 Map a list of dictionaries

📝 Instructions:

  1. At this time, the function format_greeting is printing the names only. Please update the mapping function so it creates a list where each item contains the following:
'Hello, my name is <name> and I am <age> years old'

💡 Hints:

  • You have to get the age of each person based on their birth_date.

  • Take your time to understand the already defined calculate_age function.

  • Search in Google "How to get the age of a given birth date in python".

  • Inside your format_greeting function you have to return a concatenation.

💻 Expected result:

The result should be similar to this, but the ages might be different.

[ 'Hello, my name is Joe and I am 32 years old',
  'Hello, my name is Bob and I am 42 years old',
  'Hello, my name is Erika and I am 28 years old',
  'Hello, my name is Dylan and I am 18 years old',
  'Hello, my name is Steve and I am 14 years old' ]