Welcome to the CSC Q&A.
Get help and give help!
Write great code!
It is our choices... that show what we truly are, far more than our abilities.


+1 vote

I'm getting an error in my code saying 'int' is not iterable for my line that says
if complaintDict['Company'] in numComplaintsDict:

    numComplaintsDict[company] = numComplaintsDict[company] + 1

What is wrong?

asked in CSC201 Spring 2021 by (8 points)

1 Answer

+1 vote

numCompaintsDict[company] is string type not integer, if you want to count up the complaints, I think you should access the value of a key which is the company.

answered by (8 points)