taking dictionary input in python code example
Example 1: printing dictionary in python
mydict = {'score1': 41,'score2': 23}
mydict['score3'] = 45
# key value pairs
for i in mydict:
print(i,mydict[i])
Example 2: how to take input for dictionary in python
for i in range(3):
data = input().split(' ')
d[data[0]] = int(data[1])
Example 3: dictionary input from user in python3
d=dict(input().split() for x in range(n))
print(d)