From 398cdd4af62d5a8dbdce17e058d47c4cb8b3c4fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luiz=20Ot=C3=A1vio?= Date: Sat, 29 Oct 2022 11:05:01 -0300 Subject: [PATCH] =?UTF-8?q?Tipo=20list=20-=20Introdu=C3=A7=C3=A3o=20=C3=A0?= =?UTF-8?q?s=20listas=20mut=C3=A1veis=20em=20Python?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aula48.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 aula48.py diff --git a/aula48.py b/aula48.py new file mode 100644 index 0000000..a53f62b --- /dev/null +++ b/aula48.py @@ -0,0 +1,19 @@ +""" +Listas em Python +Tipo list - Mutável +Suporta vários valores de qualquer tipo +Conhecimentos reutilizáveis - índices e fatiamento +Métodos úteis: append, insert, pop, del, clear, extend, + +""" +# +01234 +# -54321 +string = 'ABCDE' # 5 caracteres (len) +# print(bool([])) # falsy +# print(lista, type(lista)) + +# 0 1 2 3 4 +# -5 -4 -3 -2 -1 +lista = [123, True, 'Luiz Otávio', 1.2, []] +lista[-3] = 'Maria' +print(lista) +print(lista[2], type(lista[2]))