Concatenando e estendendo listas

This commit is contained in:
Luiz Otávio
2022-10-29 12:29:07 -03:00
parent 2e8b5420a9
commit 50fb09af9e

View File

@@ -14,12 +14,8 @@ Métodos úteis:
Create Read Update Delete
Criar, ler, alterar, apagar = lista[i] (CRUD)
"""
# 0 1 2 3
lista = [10, 20, 30, 40]
lista.append('Luiz')
nome = lista.pop()
lista.append(1233)
del lista[-1]
# lista.clear()
lista.insert(100, 5)
print(lista[4])
lista_a = [1, 2, 3]
lista_b = [4, 5, 6]
lista_c = lista_a + lista_b
lista_a.extend(lista_b)
print(lista_a)