edited by
509 views

1 Answer

0 0 votes

The best way is to how b is copied below. As we can see, a is impacted by any changes we make on c but not b, 

a = [1,2,3]
b=a[:]
c=a

b.append(99)
c.append(4)
print ("a=",a,"b=",b,"c=",c)

outputs 

a= [1, 2, 3, 4] b= [1, 2, 3, 99] c= [1, 2, 3, 4]

 

Related questions

1 1 vote
1 1 answer
1.1k
1.1k views
engy.abdelazeez asked Feb 28, 2019
1,100 views
I’ve heard that it’s hard to visualize the output of random forest models with large trees/forest but I’m finding it hard to understand what the use case for the model i...
1 1 vote
1 1 answer
580
580 views
lopezkev asked Oct 15, 2018
580 views
Given the questions:1. How many different groups of 4 students can be made from a class of 40?and2. How many different lists of 4 students can be made from a class of 40?...
1 1 vote
0 0 answers
408
408 views
0 0 votes
1 1 answer
901
901 views