Hey folks! I’m having a problem getting through this part of the Calculating Artists ages mission in the Python Data Analysis course:
This is my code:
ages =  for row in moma: date = row birth = row if type(birth) == int: age = date - birth else: age = 0 ages.append(age) final_ages =  for age in ages: if age > 20: final_age = age else: final_age = "Unknown" final_ages.append(final_age) print(len(ages)) print(len(final_ages)) print(len(moma))
The code runs fine and I get the same lengths for all of them, but when I try to submit the answer I get this error from DataQuest:
- ages is shorter than we expected.
- final_ages is shorter than we expected.
I can’t seem to pin down what I’m doing wrong and if I’m doing something wrong. My code matches the answer as well. Any guesses?