-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path12_Listas.py
More file actions
45 lines (33 loc) · 816 Bytes
/
12_Listas.py
File metadata and controls
45 lines (33 loc) · 816 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
def main():
l = ["Joao","Joao", "Carlos", "Joaquim",44,55.4,
[2,3,5,6],
[1,2,["a",["b",["c"]]]]
]
print(l)
for k in l:
print(k)
k = "alterado"
k = l[6]
k_type = type(l[6][1])
l.append("Antonio")
l.insert(0, "asda")
print(l)
l.insert(-1, "Joana<----") #Alterar aqui o id
l.insert(99999, "asd")
print(l)
if "Joao" in l:
print("Existe!")
if [1,2,["a",["b",["c"]]]] in l:
print("existe")
try:
l.remove("Joaodsads")
except Exception as error:
pass
print(l)
print("Depois de adicionar:")
print()
for k in l:
print(str(k) + " -> \t" + str(type(k))) #Retirar conversao str para teste
#print(l)
if __name__ == "__main__":
main()