Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Merge two dictionaries in a single expression

currentEmployee = {1: 'Scott', 2: "Eric", 3:"Kelly"}
formerEmployee  = {2: 'Eric', 4: "Emma"}

allEmployee = {**currentEmployee, **formerEmployee}
print(allEmployee)
Source by pynative.com #
 
PREVIOUS NEXT
Tagged: #Merge #dictionaries #single #expression
ADD COMMENT
Topic
Name
8+4 =