Answers for "python extraer ultimo elemento lista"

1

python extraer primer elemento lista

lista = [1, 2, 3]
elemento = lista.pop(0)
print(elemento) # 1
print(lista) # [2, 3]
Posted by: Guest on January-23-2021
0

python extraer ultimo elemento lista

mi_lista = [10, 20, 30]
elemento = mi_lista.pop()
print(elemento) # 30
print(mi_lista) # [10, 20]
Posted by: Guest on January-23-2021

Python Answers by Framework

Browse Popular Code Answers by Language