To merge two dictionaries d1 and d2, you can use d1.______(d2).
- combine
- join
- merge
- update
You can merge two dictionaries in Python by using the update() method on d1, passing d2 as an argument. This will update d1 with the key-value pairs from d2.
Loading...
Related Quiz
- You are assigned to write a Python script that needs to execute a block of code only if a file exists at a specified location. How would you implement this control structure to check the existence of the file and execute the block of code?
- In Seaborn, how can you visualize the linear relationship between two variables?
- How can you capture the error message of an exception into a variable?
- A dictionary in Python can have values of _______ data types.
- Which Python module would you use for logging error and debugging messages?