Lesson 7 of 34 · Fundamentals
Quiz: Python Fundamentals
You've covered a lot of ground: printing output, storing values in variables, Python's core data types (int, float, str, bool, None), arithmetic operators like // and %, string methods and f-strings, decisions with if/elif/else, and repetition with for, range() and while.
Answer these six questions to lock in the fundamentals before you face the chapter boss. Read every explanation — even for the questions you get right — because each one highlights a detail that trips up beginners.
What this quiz covers
The questions check what you learned in the Fundamentals chapter of Learn Python. Not sure about a topic? Review its lesson first:
- Python Hello World: Your First Program
Write your first Python program with print(), learn how Python runs code line by line and add comments. It all runs in your browser — no install.
- Python Variables and Data Types
Learn Python variables and the core data types — int, float, str, bool and None — plus type() and type conversion, with an interactive exercise.
- Python Numbers and Arithmetic Operators
Master Python arithmetic: + - * /, floor division //, modulo %, exponent **, operator precedence and float gotchas. Practise with real code.
- Python Strings and f-Strings
Work with Python strings: indexing, slicing, string methods like strip(), upper() and replace(), and formatting values with f-strings. Interactive lesson.
- Python If, Elif and Else Statements
Make decisions in Python with if, elif and else, comparison and logical operators (and, or, not) and truthy values. Write and test real code.
- Python Loops: for, range() and while
Repeat work with Python for loops, range(), while loops, break and continue. Learn the accumulator pattern and how to avoid infinite loops.
Keep learning
Need a quick reminder? The Python cheat sheet has every topic of Learn Python on one page.
Lesson last updated on .