Hacking The Fender: DictReader Not Creating a Dictionary

Hi, I’m doing the Hacking The Fender module:

import csv

compromised_users =

with open(‘passwords.csv’) as password_file:

password_csv = csv.DictReader(password_file)

for password_row in password_csv:

print(password_row)

The output that I get is like this instead of just dictionary with Username and Password as key.
Can anybody point out what’s wrong?

(‘Password’, ‘Da*E%OuGuc9$V1m’)])
OrderedDict([(‘Username’, ‘haydenashley’), (‘Password’, ‘l$r^9eGg8f@BZhy’)])
OrderedDict([(‘Username’, ‘michaelastephens’), (‘Password’, ‘$1sp++bga8H+eCr’)])
OrderedDict([(‘Username’, ‘denisephillips’), (‘Password’, ‘Vj)T7AsfRHkfpvw’)])
OrderedDict([(‘Username’, ‘andrew24’), (‘Password’, ‘T^mH8LMM&0C3VVk’)])
OrderedDict([(‘Username’, ‘kaylaabbott’), (‘Password’, ‘!nN05pv3tc(DBO(’)])
OrderedDict([(‘Username’, ‘tmartinez’),

Try writing a more elaborate print scheme that focuses on attributes.

Thanks for the reply, but the tutorial shows DictReader return as dictionary instead of what I get.

There is no straight-forward way to print an ordered dictionary “beautifully” as far as I know. Most of the solutions involve either transforming your dictionary into a JSON file first or using the “pprint” package (or both). You can see more about this issue on this StackOverflow discussion.