stationary = { }
while((ch == 1) or (ch == 2))
print(” 1. Add Item \n 2. Delete Item”)
ch = int(input(“Enter your choice “))
if(ch==1):
n = int(input(“Enter the number of items to be added in the stationary shop”))
for i in range(n):
item = input(“Enter an item “)
brand = input(“Enter the brand Name”)
stationary[item] = brand
print(stationary)
elif(ch == 2):
remitem = input(“Enter the item to be deleted from the shop”)
dict.pop(remitem)
print( stationary)
else:
print(“Invalid options. Type 1 to add items and 2 to remove items “)
ch = int(input(“Enter your choice :”)
Output:
- Add item
- Delete Item Enter your choice: 1
Enter the number of items to be added in the stationary shop : 2
Enter an item : Pen
Enter the brand Name : Trimax
Enter an item : Eraser
Enter the brand Name : Camlin
Pen : Trimax
Eraser : Camlin
Enter your choice : 2
Enter the item to be deleted from the shop : Eraser
Pen : Trimax
Enter your choice : 3
Invalid options. Type 1 to add items an 2 to remove items.