+ 1
can any one explain the code
5 Answers
+ 4
https://code.sololearn.com/c5OfoxvS4Ugi/?ref=app
+ 1
tq
+ 1
pop operation removes the element from the list,
Given list:-
a=[1,2,3,4,5,6,7]
So range is from 0 to 3 i.e (0,1,2)
for i =0, a.pop(0) removes 1 from the list, so now a = [2,3,4,5,6,7]
for i =1, a.pop(1) removes 3 from the list, so now a = [2,4,5,6,7]
for i =2, a.pop(2) removes 5 from the list, so now a = [2,4,6,7]
and at print(a), we get[ 2,4,6,7] as final outpout
0
A set of instructions given to the electronic device, to perform specific tasks. Code is a medium though which human being can communicates with machine. We can solve our daily life problems using electronic devices and to solve these problem we need to code.