+ 1

What must be the output of this code? Plzz answer with proper solution......

a=[1,2,3] b=a a.append(10) print(len(b))

14th Dec 2019, 10:18 AM
Rakesh Minase
Rakesh Minase - avatar
3 odpowiedzi
+ 6
The output is 4 a= [1,2,3] #this is a list including three items so len(a)=3 b=a# b is equal to a a.append( 10)# this adds the item 10 to the end of list a so a= [1,2,3,10] print (len(b))# now len(a) = 4 a=b so len(a)= len(b)= 4 Hope this helps 🙂
14th Dec 2019, 10:26 AM
Elen V
Elen V - avatar
+ 3
If only sololearn had a code playground..
14th Dec 2019, 10:19 AM
Aymane Boukrouh
Aymane Boukrouh - avatar
+ 2
Please tag Python, as that is the language relevant to your question. 'plzz' doesn't bear any relevance with your question topic. For future reference follow this guide to posting a question 👍 https://www.sololearn.com/Discuss/333866/?ref=app
14th Dec 2019, 2:00 PM
Ipang