Intermediate mission 2/11 python data analysis basics

Screen Link:

Your Code: ``` ages =
for row in moma:
date = row[6]
birth = row[3]
if type(birth)== int:
age = date - birth
age = 0

final_ages =
for age in ages:
if age > 20:
final_age = ages
final_age = “Unknown”

What I expected to happen: Firstly, loop through the data set and create a list of ages and then finally use this list of ages to create a frequency table.

What actually happened: When I run my code it tells me an infinite loop.

Other details:

Hi @sntohsi17. It looks like the problem might be occurring from this line in your code:

if age > 20:
     final_age = ages

ages is the name of the list you’re looping through, and age is your iteration variable. I think what you want is this instead:

if age > 20:
    final_age = age

I hope that helps.