Intermediate mission 2/11 python data analysis basics

Screen Link: https://app.dataquest.io/m/331/python-data-analysis-basics/2/calculating-artist-ages

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

final_ages =
for age in ages:
if age > 20:
final_age = ages
else:
final_age = “Unknown”
final_ages.append(final_age)
```

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.