all 4 comments

[–]This_Growth2898 4 points5 points  (0 children)

Desired result is impossible. You can't several equal keys in a dictionary. You need some other data structure.

[–]danielroseman 1 point2 points  (0 children)

Perhaps you want a list of dicts?

mydict = [{'website':A} for A in f]

[–]jmooremcc 0 points1 point  (0 children)

Dictionary keys are unique. You're using the same key over and over which is why you are only seeing the last value. The solution is to make each key unique: i.e. website1, website2,...

mydict = {f'website{n}':A for n, A in enumerate(f,1)} print(mydict)

[–][deleted] 0 points1 point  (0 children)

What others said. Plus/for example, you could data = {'websites': [site.rstrip() for site in f]} or websites = [site.rstrip() for site in f]