Python Quiz: Test Your Python Skills
This free Python skills test has 10 questions, from the basics to pandas. Finish it to see your level, with every answer explained.
Which two numbers does this code print?
print(7 // 2, 7 % 2)What this Python quiz covers, what each skill level means, sample questions with answers, and what to learn next.
What the Python quiz covers
This Python quiz is a 10-question Python knowledge test covering four topics, ordered from the basics to pandas. Most questions show a short snippet and ask what it prints or returns. The “write the code” questions give you a goal, and you pick the code that does it.
| Topic | Level | Questions |
|---|---|---|
| Python basics: operators, strings, and input | Beginner | 3 |
| Data structures: lists, dictionaries, and comprehensions | Beginner to intermediate | 3 |
| Object-oriented programming: classes and inheritance | Intermediate | 2 |
| pandas: filtering and grouping data | Advanced | 2 |
It’s a Python online test, so there’s nothing to install. Every snippet runs on Python 3, and the pandas questions use one small table of products. There’s no timer like in a Python coding test at a job interview, so take your time with each answer. When you finish, you’ll see your score, your level, a breakdown by topic, and an explanation for every answer, including the ones you got right.
Python skill levels
Python is one of the most used languages in tech: 58% of developers in Stack Overflow’s 2025 Developer Survey said they use it, up 7 percentage points from 2024. Your score on this Python test places you at one of three levels. Here’s what each one means and what you can build at it:
Beginner (0–4 correct)
You can read short scripts and write small programs of your own, like a tip calculator or a number-guessing game. Types, slicing, and loops are the rules to lock in before bigger projects.
Intermediate (5–7 correct)
You use lists and dictionaries with confidence and write scripts that work. You can automate everyday tasks, like cleaning up a CSV file, renaming hundreds of files, or pulling data from an API, and start organizing bigger programs into classes.
Advanced (8–10 correct)
You write classes others can reuse and analyze data with pandas. You can build data-cleaning pipelines, reports that update themselves, and the data prep behind machine learning models. That’s what a Python coding test in a data or engineering interview often checks.
Sample Python quiz questions
Starting out? These three questions make a short Python quiz for beginners, with answers. They aren’t in the test itself, so try them as a quick Python practice test before you start.
1. What does this code print?
x = 5
x += 2
print(f"x is {x * 2}")Answer: x is 14. The += operator adds 2 to x, so x becomes 7. An f-string runs the expression inside the curly braces, x * 2, and puts the result into the text.
2. What’s the difference between == and is?
a = [1, 2]
b = [1, 2]
print(a == b, a is b)Answer: It prints True False. == checks whether two values are equal, and is checks whether two names point to the same object. a and b hold equal values, but they’re two separate lists. In practice, use is only to check for None, as in if result is None.
3. Write the code: print each fruit with its position, starting from 1.
fruits = ["apple", "banana", "cherry"]Answer: Use enumerate(), which gives you each item’s position and the item together. start=1 makes the count begin at 1 instead of 0:
for i, fruit in enumerate(fruits, start=1):
print(i, fruit)What to learn next
If you scored in the beginner range, start with free resources. The official Python tutorial walks through the core language step by step, and TripleTen’s guide to basic coding concepts explains variables, loops, and functions with Python examples. Write a little code every day, and retake this Python online test in a few weeks to see how far you’ve come.
Once the basics click, look at where Python can take you. The Quality Assurance program uses Python with Selenium and Pytest to automate software tests. If you’d rather build workflows with AI tools than write code all day, AI Automation is a no-code path into tech.
If you scored intermediate, you already have the Python that data work runs on. The Data Analytics program adds SQL, Power BI, and predictive analytics, and you’ll finish with a portfolio of projects for data analyst roles. It starts from zero, so it’s open to beginners too.
If you scored advanced and have 2+ years of production experience, the AI & Machine Learning program is a 20-week accelerator into AI and ML roles. You’ll build Python depth, learn the math behind the models, and deploy models with MLOps tools.
FAQ
How long does it take to learn Python?
Most beginners can write simple Python scripts after a few weeks of regular practice. Getting comfortable with classes, pandas, and bigger projects usually takes several months. Using Python on the job takes longer, since you’ll also learn the tools around it, like SQL, Git, and the libraries your field uses. Short daily practice tends to work better than long weekend sessions.
How to be really good at Python?
Build things. Pick small projects that solve your own problems, like a budget tracker or a script that sorts your downloads, and make each one a little harder than the last. Along the way, read other developers’ code, learn the standard library, follow the PEP 8 style guide, and write tests with pytest. Feedback speeds this up the most: a code review from a more experienced developer shows you habits you can’t spot on your own.
Is Python hard to study?
Python is one of the easier programming languages to learn. Its syntax reads close to plain English, and you can run your first line of code in minutes. The harder part comes later, when you move from syntax to solving problems: breaking a task into steps, debugging, and structuring bigger programs. That part comes from practice more than talent.
Is Python enough to get a job?
Usually not on its own. Employers hire for a role, and Python is one tool in it: data analysts also use SQL and a dashboard tool like Power BI, QA engineers use testing frameworks like Selenium and Pytest, and machine learning engineers add statistics and model deployment. Many technical interviews also include a Python coding test, so practice solving problems against the clock too.