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.

Categories

0 votes

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 ago in CSC201 Spring 2021 by (1.9k 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 ago by (2.6k points)
...