From 155229c35ce5b4b25f68afe3b54041009578fdad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luiz=20Ot=C3=A1vio?= Date: Thu, 3 Nov 2022 11:39:54 -0300 Subject: [PATCH] =?UTF-8?q?Introdu=C3=A7=C3=A3o=20=C3=A0=20List=20comprehe?= =?UTF-8?q?nsion=20em=20Python?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aula84.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 aula84.py diff --git a/aula84.py b/aula84.py new file mode 100644 index 0000000..a9be542 --- /dev/null +++ b/aula84.py @@ -0,0 +1,14 @@ +# Introdução à List comprehension em Python +# List comprehension é uma forma rápida para criar listas +# a partir de iteráveis. +# print(list(range(10))) +lista = [] +for numero in range(10): + lista.append(numero) +# print(lista) + +lista = [ + numero * 2 + for numero in range(10) +] +print(lista)