My Code:
frequency_rating = {‘0 - 500000’: 0, ‘500000 - 1000000’:0, ‘1000000 - 1500000’:0, ‘1500000 - 2000000’:0, ‘2000000+’:0}
for row in apps_data [1:]:
rating_count_tot = float(row[5])
if rating_count_tot <= 500000:
frequency_rating[‘0 - 500000’] += 1
elif 500000 < rating_count_tot <= 1000000:
frequency_rating[‘500000 - 1000000’] += 1
elif 1000000 < rating_count_tot <= 1500000:
frequency_rating[‘1000000 - 1500000’] =+ 1
elif 1500000 < rating_count_tot <= 2000000:
frequency_rating[‘1500000 - 2000000’] += 1
elif rating_count_tot > 2000000:
frequency_rating[‘2000000+’] += 1
print (frequency_rating)
print (7175 + 16 + 1 + 1 + 3)
print (len(apps_data[1:]))
**Results:**
{'0 - 500000': 7175, '500000 - 1000000': 16, '1000000 - 1500000': 1, '1500000 - 2000000': 1, '2000000+': 3}
7196
7197
It looks good to me but when I total the numbers, I got 7196 instead of expected 7197. I can't figure out what happened to short 1. Since the challenge is to come up with our own intervals, mine is different than the provided answer. I copied the provided answered and ran it to indeed 7197.
Thank you!