Screen Link: https://app.dataquest.io/m/331/python-data-analysis-basics/9/challenge-summarizing-artwork-gender-data
My Code:
gender_freq={}
for row in moma:
gender = row[5]
if gender not in gender_freq:
gender_freq[gender] = 1
else:
gender_freq[gender] += 1
for gender, num in gender_freq.items():
template= "There are {n:,} artworks by {g} artists"
output=template.format(g=gender, n=num)
output
What I expected to happen:
I expect when I create variable “output” and print it, it will be the same result as the answer
What actually happened:
'There are 791 artworks by Gender Unknown/Other artists'