Write a code to create customer’s list with their number & name and delete any particular customer using his /her number.
Write a code to create customer’s list with their number & name and delete any particular customer using his /her number.
1 Answers
customer=dict( )
n=input(” Enter total number of customers”)
i=l
while i<=n:
a=raw_input(“enter customer name”)
b=raw_input(“enter customer number”)
customer[a]=b
i=i+l
name=raw_input(” enter customer name to delete”)
del customer[name]
l=customer.keys( )
print “Customer Information”
print “Name”/\t’/’number”
for i in 1:
print i/\t’,customer[i]
Output :
Enter total number of customers 5
enter customer name Rohan
enter customer number 123678
enter customer name Ranjish
enter customer number 123677
enter customer name Suraj
enter customer number 123899
enter customer name Damu
enter customer number 123777
enter customer name Dhariya
enter customer number .123885
enter customer name to delete Suraj
Customer Information
Name number
Rohan 123678
Dhariya 123885
Ranjish 123677
Damu 123777