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.
Press Run to see the output here.
Type your own weight, or add another world to the list. Open the full editor →
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.
Check that a crew member holds every permission an airlock action needs with needed <= granted, list what is missing with needed - granted, then check every action in a dict of required permissions.
Build a dict that maps every cargo ID to its record, so any item is found with one lookup instead of a search through the list, then answer a list of requests, including an ID that isn't on the manifest.
Move the mission log's f-string into format_log(t, level, msg), a function that returns the line instead of printing it, then fix the alignment of every log line with one change inside the function.
Three short programs to read, run and change. A new set tomorrow.
How to write comments in Python. Comments help other programmers understand your code.
The print() function is the basic tool for displaying data in Python console.
F-strings are a modern way to format text in Python. Insert variables directly into text.
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.