· 3 min read

Study Python Data Structures in Spanish: 125 Flashcards on Lists, Comprehensions and Generators

Spanish-language explanations, English API fronts: study Python lists, tuples, sets, dicts, comprehensions and generators with deck NP8404 and its 125 real cards.

Flat vector illustration of a violet python winding through nested containers and stacked boxes among floating flashcards

Studying. But it's also a video game. 🎮

Flashcards, quizzes and games that make you actually remember.

Start playing — it's free

Posted by

Spanish-speaking Python learners get a very specific object here: NP8404 — Python: Estructuras de datos y comprensiones, 125 cards whose fronts stay in English (list.append(x), Walrus operator) while every explanation is in Spanish. That split is deliberate: the API names you will actually type never get translated, only the reasoning around them.

Study this deck: Python: Estructuras de datos y comprensiones

1 / 10
Question

List.append(x)

Knew itLearning

Tap the card for the answer · swipe right if you knew it, left if not

What the 125 cards hold

Front (English)Back (Spanish)
List.extend(iterable)Extiende la lista agregando todos los elementos del iterable (similar a a[len(a):] = iterable)
List.pop([i])Elimina y devuelve el elemento en la posición i. Sin índice, devuelve el último. Lanza IndexError si la lista está vacía
Why are lists not efficient as queues?Agregar/quitar al final es rápido, pero insertar/quitar al principio es lento (todos los elementos deben desplazarse)
Create a tuple with one itemAgrega una coma después del valor: ('hello',); los paréntesis solos no son suficientes
Create an empty setUsa set(), no {} que crea un diccionario vacío
Dict.get(key)None (o un valor por defecto especificado si se proporciona)
Walrus operator:=, permite hacer asignaciones dentro de expresiones (a diferencia de C, donde se usa =)
list comprehension vs generator expressionLa comprensión de lista [] devuelve una lista (todos los valores en memoria); la expresión generadora () devuelve un iterador perezoso
What exception does a generator raise when exhausted?StopIteration: la lanza __next__() cuando ya no quedan elementos
Preferred way to transpose a matrixlist(zip(*matrix)): se prefieren las funciones integradas frente a comprensiones complejas

You cover: los once métodos de lista (append, extend, insert, remove, pop, clear, index, count, sort, reverse, copy), pilas y colas con collections.deque, del frente a pop, empaquetado y desempaquetado de tuplas, claves hashables, orden de inserción desde Python 3.7, items(), enumerate(), zip(), reversed(), sorted(), comparaciones encadenadas, cortocircuito, orden lexicográfico, comprensiones anidadas, aplanado de listas, yield, send(), close(), throw(), yield from, generadores recursivos, evaluación perezosa, y any() / all() / sum() / max() sobre generadores.

It is two decks stitched together

Cards 1-75 follow chapter 5 of the official tutorial. Card 76 restarts from scratch on comprehensions and runs to 125, adding generators. The seam produces a dense cluster of duplicates: 16/76 (comprehension syntax), 17/77 (squares), 18/102 (parenthesising tuples), 33/84 (set comprehension), 42/83 (dict comprehension), 64/79/120 (transpose), 75/98 (flattening).

Keep the second card of each pair — the later block shows Resultado: with the real output, which turns a definition into a check. One exception: cards 79 and 120 hardcode range(4), while card 64 gives the general range(len(matrix[0])). Keep 64 there.

Repair these before your first review

The fronts were sentence-cased somewhere in the pipeline, and Python is case-sensitive: List.append, Set(), Dict(), Iter(), Zip(), Any(), Max() should all be lowercase — capitalised List, Set and Dict are typing generics, not the builtins. Three fronts lost their question: card 32 is just - b (read a - b), card 39 is D[key] with the back KeyError, card 71 is Set() answered by elimina duplicados. Two backs stop mid-word — the recursive generator on card 122 ends at yield fro, card 125 at op. Finishing them from memory makes a better card than the original.

Tip: cards 9, 10, 12, 67 and 68 all restate one rule — mutable in-place methods return None. Collapse them into a single card contrasting a.sort() with sorted(a), and spend the freed slots on what the deck skips: the set operators |, &, ^ (only difference appears, in the broken card 32), collections.Counter, and a worked sorted(key=...) example.

The deck is NP8404 in your Flip It library — sign in at flip-it.app to add it.

Related: Memorize Python Data Structures and Comprehensions (the English original) · Learn Python Data Structures in French

Ready to learn faster? 🚀

Join FLIP IT for free and turn studying into a game.

Create my free account