So, I’m working on the “Hacking the Fender” freeform project in the Files section of Python 3:
Here is my code:
import csv compromised_users =  with open("passwords.csv", "w") as password_file: password_csv = csv.DictReader(password_file) for password_row in password_csv: print(password_row)
Everything was fine until I added the for loop. Now I get the following error:
Traceback (most recent call last): File "script.py", line 7, in <module> for password_row in password_csv: File "/usr/lib/python3.5/csv.py", line 109, in __next__ self.fieldnames File "/usr/lib/python3.5/csv.py", line 96, in fieldnames self._fieldnames = next(self.reader) io.UnsupportedOperation: not readable
My code is the same as the walk-through – I checked because I can’t find an issue with the code myself. Does anyone else see where I’m going wrong?
Thanks in advance!