take input and create dictionary in python code example
Example 1: how to take input for dictionary in python
for i in range(3):
data = input().split(' ')
d[data[0]] = int(data[1])
Example 2: create dictionary from input python
marks = {}
for i in range(10):
student_name = input("Enter student's name: ")
student_mark = input("Enter student's mark: ")
marks[student_name.title()] = student_mark
print(marks)