I'm trying to get the output {'apple': '8.5', 'orange': '9.5'}
But all I'm getting is {'apple': '8,5} {'orange' '9.5'}
Any help would be really appreciated
example.txt:
name, price
apple 8.5
orange 9.5
name = "example.txt"
file = open(name, 'r')
next(file)
for line in file:
dict= {}
stripped_line = line.strip()
data = stripped_line.split(" ")
name = data[0]
price = data[1]
dict[name] = price
print(prices)
fhand.close()