/python-dictionary-family-exercise

practicing dictionary comprehensions

Primary LanguagePython

The Family Dictionary

Setup

mkdir -p ~/workspace/python/exercises/family_dictionary && cd $_
touch family_dict.py

Instructions

  1. Define a dictionary that contains information about several members of your family. Use the following example as a template.

    my_family = {
        'sister': {
            'name': 'Krista',
            'age': 42
        },
        'mother': {
            'name': 'Cathie',
            'age': 70
        }
    }
    
  2. Using a dictionary comprehension, produce output that looks like the following example.

    Krista is my sister and is 42 years old
    

    Helpful hint: To convert an integer into a string in Python, it's str(integer_value)