Saturday, September 12, 2020

384 - pop method upon an array in python

 384 - pop method upon an array in python


 

 

pop method upon an array in python

===============================

 

'pop' method removes the specified item from the array

and returns the array. And if no element is specified

then the last index element in the array is removed and

the array is returned .

 

example:

import array as ar

a = ar.array('i',[10,20,30,40,50])

a.pop(10)

a.pop()

a.pop()

 

output:

array('i',[20,30,40,50])

array('i',[20,30,40])

array('i',[20,30])

 

 

 


No comments:

Post a Comment

Durga Puja in Odisha

 Durga Puja in Odisha