l1 = [ 1,2,3 ]
l2 = [ l1, [10,20,30] ]
l3 = [ l1, [10,20,30] ]
l1.append(4)
l2[1].append(40)
print(l1)
print(l2)
print(l3)
Created
May 11, 2019 15:53
-
-
Save leangaurav/22bb839c168a7432ff6472f16e9b0709 to your computer and use it in GitHub Desktop.
Outpu Example for Practice
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` | |
l1 = [ 1,2,3 ] | |
l2 = [ l1, [10,20,30] ] | |
l3 = [ list(l1), [10,20,30] ] | |
l1.append(4) | |
l2[1].append(40) | |
print(l1) | |
print(l2) | |
print(l3) | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment