Q. Write a program to enter names of employees and their salaries as input and store them in a dictionary.
Answer =
dic = { } while True : name = input("Enter employee name :-") sl = int(input("Enter employee salary :-")) dic[ name] = sl user = input("Do you want to quit then enter yes :-") if user == "yes" : break print(dic)
Output :-
Enter employee name :-Path
Enter employee salary :-1000
Do you want to quit then enter yes :-no
Enter employee name :-Walla
Enter employee salary :-2000
Do you want to quit then enter yes :-no
Enter employee name :-PW
Enter employee salary :-10000
Do you want to quit then enter yes :-yes
{'Path': 1000, 'Walla': 2000, 'PW': 10000}
>>>
Thanks
ReplyDeleteWelcome : )
DeleteOutput
ReplyDeleteOk
Deletedhanyawad
ReplyDeleteWelcome😊
Delete😊
ReplyDeleteThanks dude
ReplyDeleteWelcome 😊😊
DeleteThanks bro
ReplyDeleteWelcome 😊😊😊
Deletethank you
ReplyDeleteWelcome : )
DeleteSuiii
ReplyDelete: )
DeleteShukriya
ReplyDeleteWelcome : )
DeleteWelcome : )
Deleteany important question from type c
ReplyDeleteThank you bro 😊
ReplyDeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )