Skip to content

Commit 595ebc2

Browse files
author
renzon
committed
Filtragem
1 parent 3c3288d commit 595ebc2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
alunos = [('Renzo', 0), ('Luciano', 10), ('Ada', 9)]
2+
3+
print([(nome, nota) for nome, nota in alunos if nota > 5])
4+
5+
6+
def possui_nota_maior_que_5(aluno):
7+
_, nota = aluno
8+
return nota > 5
9+
10+
11+
print(list(filter(possui_nota_maior_que_5, alunos)))

0 commit comments

Comments
 (0)