How to Copy a Dictionary in Python|copy() Method|Shallow Copy of Dictionary

preview_player
Показать описание
How to Copy a Dictionary in Python|copy() Method|Shallow Copy of Dictionary
you will learn:-
1) copy() method
2) how to copy dictionary

source code :-

About Python Tutorial:- python for beginners-Go from Zero to Hero in python.This tutorial includes python programming videos from basics to advanced

More tutorials:-

About codeyug :-
Codeyug provides tutorials for building your programming skills.Here,you will learn various programming languages,computer science,web development with free of cost.

SHARE | SUBSCRIBE | LIKE
-- - - - - - - - - - - - - - - - - -Thanks for watching this video - - - - - - - - - - - - - - - - - -- -
Our social links:-
creator:-
$ -shantanu kejkar -$

#python #python3 #programming #codeyug #comments #tutorial #beginners #coding
Рекомендации по теме
Комментарии
Автор

#copy () method
"""
creates new copy of the dict with different memory address and return something.
syntax:
dict_name.copy() doesn't take arguments """


a = { "karan" : 26, "raj" : 67, "ashish":76, "ramesh": 80, "manish":81}
b=a.copy()
print(a)
print(a)
print(id(a)) #hence IDs are different soo its return a new copy
print(id(b))

KaranSinghD-yjep
join shbcf.ru