Assignment1.py
def createAgeGroups(people, read, year, month, day):
    '''
    Parses through the participants dictionary and sort the participants into sub dictionaries by to their age relative to the
    entered date. Uses the getAge() function to get the age, then sorts the participants into the respective dictionaries
    Below are index's for easier readability debugging.

           peopleKey = ID                   fiveU = dictionary for participants from 1 to 5 years old.
           people[0] = FNAME                sixToNine = dictionary for participants from 6 to 9 years old.
           people[1] = LNAME                tenO = dictionary for participants from 10 to 13 years old.
           people[2] = DATE 

    Para: 
            people: dictionary
            read: dictionary
            year: integer
            month: integer
            day: integer

    Returns:
            fiveU: dictionary
            sixToNine: dictionary
            tenO: dictionary
    '''
    fiveU, sixToNine, tenO = {}, {}, {}
    for key in people:
        age = getAge(year, month, day, people[key][2])
        if age <= 5:
            fiveU[key] = [people[key][0], people[key][1]]
        elif age <= 9:
             sixToNine[key] = [people[key][0], people[key][1]]
        elif age <= 13:
            tenO[key] = [people[key][0], people[key][1]]

    return fiveU, sixToNine, tenO

    Parses through the participants dictionary and sort the participants into sub dictionaries by to their age relative to the
    entered date. Uses the getAge() function to get the age, then sorts the participants into the respective dictionaries
    Below are index's for easier readability debugging.

           peopleKey = ID                   fiveU = dictionary for participants from 1 to 5 years old.
           people[0] = FNAME                sixToNine = dictionary for participants from 6 to 9 years old.
           people[1] = LNAME                tenO = dictionary for participants from 10 to 13 years old.
           people[2] = DATE 

    Para: 
            people: dictionary
            read: dictionary
            year: integer
            month: integer
            day: integer

    Returns:
            fiveU: dictionary
            sixToNine: dictionary
            tenO: dictionary
    
Parses through the participants dictionary and sort the participants into sub dictionaries by to their age relative to the
entered date. Uses the getAge() function to get the age, then sorts the participants into the respective dictionaries
Below are index's for easier readability debugging.

peopleKey = ID                   fiveU = dictionary for participants from 1 to 5 years old.
people[0] = FNAME                sixToNine = dictionary for participants from 6 to 9 years old.
people[1] = LNAME                tenO = dictionary for participants from 10 to 13 years old.
people[2] = DATE


Parses through the participants dictionary and sort the participants into sub dictionaries by to their age relative to the entered date . Uses the getAge () function to get the age then sorts the participants into the respective dictionaries Below are index ' s for easier readability debugging . peopleKey = ID fiveU = dictionary for participants from 1 to 5 years old . people [ 0 ] = FNAME sixToNine = dictionary for participants from 6 to 9 years old . people [ 1 ] = LNAME tenO = dictionary for participants from 10 to 13 years old . people [ 2 ] = DATE
def createAgeGroups(people, read, year, month, day):
    fiveU, sixToNine, tenO = {}, {}, {}
    for key in people:
        age = getAge(year, month, day, people[key][2])
        if age <= 5:
            fiveU[key] = [people[key][0], people[key][1]]
        elif age <= 9:
             sixToNine[key] = [people[key][0], people[key][1]]
        elif age <= 13:
            tenO[key] = [people[key][0], people[key][1]]
    return fiveU, sixToNine, tenO
def createAgeGroups ( people , read , year , month , day ) : fiveU , sixToNine , tenO = { } , { } , { } for key in people : age = getAge ( year , month , day , people [ key ] [ 2 ] ) if age <= 5 : fiveU [ key ] = [ people [ key ] [ 0 ] , people [ key ] [ 1 ] ] elif age <= 9 : sixToNine [ key ] = [ people [ key ] [ 0 ] , people [ key ] [ 1 ] ] elif age <= 13 : tenO [ key ] = [ people [ key ] [ 0 ] , people [ key ] [ 1 ] ] return fiveU , sixToNine , tenO
Parses through the participants dictionary and sort the participants into sub dictionaries by to their age relative to the
entered date.
Parses through the participants dictionary and sort the participants into sub dictionaries by to their age relative to the entered date .
'''
    Parses through the participants dictionary and sort the participants into sub dictionaries by to their age relative to the
    entered date. Uses the getAge() function to get the age, then sorts the participants into the respective dictionaries
    Below are index's for easier readability debugging.

           peopleKey = ID                   fiveU = dictionary for participants from 1 to 5 years old.
           people[0] = FNAME                sixToNine = dictionary for participants from 6 to 9 years old.
           people[1] = LNAME                tenO = dictionary for participants from 10 to 13 years old.
           people[2] = DATE 

    Para: 
            people: dictionary
            read: dictionary
            year: integer
            month: integer
            day: integer

    Returns:
            fiveU: dictionary
            sixToNine: dictionary
            tenO: dictionary
    '''
None
fiveU
people
read
year
month
day