0 votes
in Python by
Dictionary could be copied to another dictionary using which of following syntax?

dict_a = dict_b

dict_a = dict_b.clear()

dict_a=dict_b.copy()

dict_a = copy(dict_b)

1 Answer

0 votes
by

They copy() statement or method in Python returns a copy of the dictionary.

Syntax of Copy() in Python is as follows:

dict_a=dict_b.copy()

Or

dict.copy()

Parameters:

The copy() method don't have any parameters.

Returns:

This method doesn't modify the original dictionary instead it just returns copy of the dictionary.

Related questions

+1 vote
asked Jul 16, 2020 in Python by GeorgeBell
0 votes
asked Jul 2, 2020 in Python by GeorgeBell
...