Blue Week Special Offer | Brighten your week!
days
hours
minutes
seconds

Error: Variable name isn't defined

Link:
https://app.dataquest.io/m/315/functions%3A-fundamentals/1/functions

My code:

‘’’
a_list = [4444, 8897, 6340, 9896, 4835, 4324, 10, 6445,
661, 1246, 1000, 7429, 1376, 8121, 647, 1280,
3993, 4881, 9500, 6701, 1199, 6251, 4432, 37]

sum_manual = 0
for list_element in a_list:
sum_manual += list_element
print(sum_manual)
sum(a_list)
‘’’

What I expected:
‘’’
103945
103945
‘’’

What actually happened:
Getting the following error when I submit answer

sum_manual isn’t defined in your code, but we expected it to be int type

Other details:

I get the expected result when I run the code. But when I try to submit answer, the above error pops up. The same thing is happening for the next lesson as well. Eventhough I have defined content_ratings as an empty dictionary, error content_ratings isn’t defined in your code, but we expected it to be dict type

Please help

Check indentation on your code. But apparently I cannot see any problem.

Hi @savi.dc,

Sorry about that! Are you still experiencing this issue?

Best,
Sahil

Thanks for your suggestion. Checked the indentation. Didn’t work.

But, the problem resolved by itself after sometime!

Hi Sahil,

Nope, it got resolved by itself after an hour or so!

Thanks,
Savitha

1 Like