How to remove and return the item at specified index from a list in Python

1 Answer

0 votes
lst = ['a', 'b', 'c', 'b', 'e', 'b', 'g'];

ch = lst.pop(1)

print(lst)
print(ch)


    
'''
run:
    
['a', 'c', 'b', 'e', 'b', 'g']
b

'''

 



answered Jun 23, 2020 by avibootz
...