I want to create the new dictionary that contents a dictionary with lists. My code is:
SERVICES = "FTP Download", "FTP Upload", "HTTP"
received = dict.fromkeys(SERVICES , {'MS1':[]})
n = 0
for service in SERVICES:
received[service]['MS1'].append(n)
n += 1
print(received)
What I got. I got the same list in every dictionary despite the fact that I used different keys.
My output is: {'FTP Download': {'MS1': [0, 1, 2]}, 'HTTP': {'MS1': [0, 1, 2]}, 'FTP Upload': {'MS1': [0, 1, 2]}}
What is the right way to create a blank dictionary from keys?