I'm having trouble creating a function with one parameter that reads from a file and then creates and returns a dictionary based on what's in the file.
And example of whats in the file:
115 139-28-4313 1056.30
135 706-02-6945 -99.06
143 595-74-5767 4289.07
155 972-87-1379 3300.26
What i have:
open('balance.txt', 'r')
for line in ('balance.txt'):
acct, SSN, balance = line.split()
balfilename[acct] = int(SSN, balance)
An error that i'm getting is: <_io.TextIOWrapper name='balance.txt' mode='r' encoding='US-ASCII'>
What am i doing wrong and what exactly is the error telling me?