pop function in python
#pop() function
L1 = [20,4,-6,38,-12]
print(' pop', L1.pop())
print('List ', L1)
x=L1.pop(2)
print(' popped:', x)
print('final List :', L1)
#output:
pop -12
List [20, 4, -6, 38]
popped: -6
final List : [20, 4, 38]
pop function in python
#pop() function
L1 = [20,4,-6,38,-12]
print(' pop', L1.pop())
print('List ', L1)
x=L1.pop(2)
print(' popped:', x)
print('final List :', L1)
#output:
pop -12
List [20, 4, -6, 38]
popped: -6
final List : [20, 4, 38]
list pop method in python
l1 = [1, 8, 7, 2, 21, 15]
l1.pop(2) # removes element at index 2
print(l1)
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us