Skip to content

Commit d92e4f6

Browse files
committed
Write a program to create a dictionary by combining two lists name for employee name and salary for employee salary. Use the list name as the key and salary as the value of dictionary elements
1 parent 9accca6 commit d92e4f6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

41.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name = ["Abhra","Suka","Indra","Shoob"]
2+
salary = [500000, 600000, 700000, 800000]
3+
4+
if len(name)!=len(salary):
5+
print("Error: The lists must have same length")
6+
else:
7+
employee_salary = dict(zip(name, salary))
8+
print("The dictionary is:",employee_salary)

0 commit comments

Comments
 (0)