Flashcards › Math & Programming
Math & Programming

Free Python Basics Flashcards

Python’s core operations are small enough to memorize completely — and doing so keeps you in flow instead of in the docs. These are the expressions working Python developers use daily.

Study these 10 starter cards

QUESTION
Tap the card to reveal the answer
QPython: how do you get the length of a list?
Alen(my_list)
QPython: merge two dictionaries (3.9+)?
Amerged = d1 | d2
QPython: what does a list comprehension look like?
A[x * 2 for x in items if x > 0]
QPython: how do you open a file safely?
Awith open("file.txt") as f: — auto-closes on exit
QPython: remove duplicates from a list (order not needed)?
Alist(set(my_list))
QPython: what is the danger of a mutable default argument?
AIt is shared across all calls — use None and create inside the function
QPython: iterate with index and value?
Afor i, value in enumerate(items):
QPython: f-string syntax?
Af"Hello {name}, you are {age}"
QPython: difference between a list and a tuple?
ALists are mutable; tuples are immutable
QPython: how do you handle exceptions?
Atry: ... except SomeError as e: ... (optionally finally:)

Turn these into lasting memory

Reading answers is recognition — remembering them next month takes spaced repetition. Build your own python basics deck and we'll schedule every review at the right moment.

Create your free deck →

How to study python basics with flashcards

Related flashcard topics

Multiplication TablesAlgebra BasicsGeometry FormulasJavaScript BasicsSQL Basics

Your first deck is free forever

No ads, no credit card — import from Anki or Quizlet, or start from these cards.

Start studying free →