25.8.0
This website uses cookies to ensure you get the best experience on our website. Learn more

Complex Data Types in Python: Shallow & Deep Copies in Python

Richmond Chin Peng Goh

Skillsoft issued completion badges are earned based on viewing the percentage required or receiving a passing score when assessment is required. Explore copying operations on containers in Python in this 9-vdeo course, which examines the subtle distinction between shallow and deep copies. Changes made to shallow copies affect the original whereas with deep copies they do not. Learners begin by observing Jupyter notebook in Python, where you will be performing shallow and deep copies of Python strings. You will learn how to create shallow copies of lists, and then create deep copies of lists where changes to the copy do not affect the original. Following this, you will begin working with tuples, a process which you will discover is quite simple because tuples are immutable. So you will learn how to create shallow and deep copies of tuples. You will also learn how deep copies of dictionaries work, and perform shallow and deep copies of sets. In the closing exercise, learners are asked to recall how shallow and deep copies work for complex data types.

Issued on

June 17, 2020

Expires on

Does not expire