Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.


+2 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 in CSC201 Spring 2021 by (1 point)

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 (1 point)