Fichas
Python definitions
Fichas del conjunto (2)
- 1What is a list comprehension?List comprehensions are a tool for transforming one list (any iterable actually) into another list. During this transformation, elements can be conditionally included in the new list and each element can be transformed as needed.
If you’re familiar with functional programming, you can think of list comprehensions as syntactic sugar for a 'filter' followed by a 'map'. - 2What is a tuple?A tuple is a collection which is ordered and unchangeable. In Python tuples are written with round brackets.
Example
Create a Tuple:
thistuple = ("apple", "banana", "cherry")
print(thistuple)
Información
- Descripción
- Python Fichas sobre Python definitions, creado por Ben Parish el 28/01/2020.
- Creado por
- Ben Parish
- Visitas
- 0
- Valoración