Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#Empty dictionary.
my_dict = {}
#Numbers of items to add.
n = int(input("How many items do you want to add to the dictionary?"))
#Loop to add items to the dictionary.
for i in range(n):
key = input("Enter the key:")
value = input("Enter the value:")
my_dict[key] = value
#Print the final dictionary.
print("Final dictionary is:", my_dict)