Python Basics Quiz
Free Python quiz for beginners: 20 multiple-choice questions on print(), strings, lists, dictionaries, loops and functions, with instant answers.
- Questions: 20
- Easy
Change one line, press Run and see what happens. Nothing to install and no account needed.
Discover the latest in space science and Python programming. Our newest articles blend astronomy concepts with coding challenges to fuel your cosmic curiosity.
AI now writes a large share of new code, so is learning Python still worth your time? Yes, but for a different reason than ten years ago. Using job data, developer surveys and recent studies on learning with AI, we look at what changed and where Python’s
Learn to write your own Python functions, from your first def to return values, default parameters and scope, with runnable examples, common mistakes and six practice projects.
In Project Hail Mary, the alien engineer Rocky counts in base 6 because he has two hands with three fingers each. In this article, you'll build Python programs that convert between decimal, base-6, and Eridian notation.
Questions and answers from other people learning Python.
A different quiz every Monday. How many will you get right?
Free Python quiz for beginners: 20 multiple-choice questions on print(), strings, lists, dictionaries, loops and functions, with instant answers.
Three challenges, different every day. Fix or write the code and let the tests check it.
Write validate_cargo(item), which returns a list of everything wrong with a cargo record: missing fields and a negative mass, then a cargo ID that doesn't match the CG- and four digits format. An empty list means the record is fine.
Add a docstring to fuel_needed() that says what it returns and what the reserve means, then add type hints for its parameters and return value; the tests read both from the function itself.
Sort launches by date with sorted() and a small function that returns each launch's date, then sort the cargo manifest heaviest first with a key function and reverse=True.
Three short programs to read, run and change. A new set tomorrow.
Python recognizes different data types automatically. Learn int, float, str and bool.
Changing data types using int(), float() and str() functions. Converting between types.
Python allows changing variable type during program execution. This is dynamic typing.
A free account saves your progress on paths, quizzes and challenges, keeps the code you write, and lets you ask and answer in the community.