Preparing for a Python internship or fresher interview? This free Python interview questions test gives you 15 random questions on basics, strings, lists and dictionaries, functions, classes, error handling, and comprehensions, and explains every answer. You get a new set of questions every time you take it.
What this Python interview test covers
Every attempt gives you 15 random questions, balanced across 7 topics, with the questions and answer options shuffled, so no two tests are the same.
| Topic | What it checks | Questions per test |
|---|---|---|
| Python basics | Data types, operators, truthiness, None, range | 3 |
| Strings | Slicing, immutability, split, join, f-strings | 2 |
| Lists, tuples, sets & dicts | Lists vs tuples, sets, dictionaries, copying, sorting | 3 |
| Functions | *args, **kwargs, lambdas, decorators, default arguments | 2 |
| Classes & OOP | __init__, self, inheritance, super(), dunder methods | 2 |
| Errors & files | try/except/finally, with open(), common exceptions | 1 |
| Comprehensions & generators | Comprehensions, generators, enumerate, zip | 2 |
How to read your score
| Score | What it means |
|---|---|
| 12–15 (80%+) | Interview-ready. Your fundamentals are strong. Practise explaining these answers out loud, then start applying. |
| 8–11 (50–79%) | Almost there. A good base with a few gaps. Review your weakest topics and retake the test with new questions. |
| 0–7 (below 50%) | Build the basics. Focus on fundamentals first, using the explanations in your results, and try again in a week. |
Sample Python interview questions for freshers (with answers)
Here are five questions of the kind the test asks, with answers and explanations.
1. What is the result of 7 // 2?
- A. 4
- B. 3
- C. 3.5
- D. 1
Answer: B. // is floor division. 7 / 2 gives 3.5, and 7 % 2 gives the remainder, 1.
2. What does this code print?
a = [1, 2, 3]
b = a
b.append(4)
print(a)
- A.
[1, 2, 3] - B.
[4] - C.
[1, 2, 3, 4] - D. An error
Answer: C. b = a makes both names refer to the same list. Use a.copy() to make a separate list.
3. What is the main difference between a list and a tuple?
- A. Tuples are mutable; lists are immutable
- B. Lists can only hold numbers
- C. Tuples cannot be indexed
- D. Lists are mutable; tuples are immutable
Answer: D. Because tuples are immutable, they can also be used as dictionary keys.
4. What is a well-known pitfall of a default argument like def add(item, items=[]):?
- A. The same list is shared across calls
- B. The list is reset to empty after each call
- C. Default arguments are not allowed for lists
- D. It makes the function slower
Answer: A. Defaults are created once when the function is defined. Use items=None and create the list inside.
5. What does [x * x for x in range(4)] produce?
- A.
[0, 1, 2, 3] - B.
[1, 4, 9, 16] - C.
[0, 1, 4, 9] - D.
[0, 2, 4, 6]
Answer: C. The comprehension squares each number from 0 to 3.
Ready to test yourself?
Take the free Python interview questions test now: 15 random questions, about 10 minutes, with an explanation for every answer.
How to prepare for a Python internship interview
- Get the core data structures right: lists, tuples, sets and dictionaries appear in almost every Python interview. The technical interview questions guide covers the common topics.
- Build one real project: a small Flask or FastAPI app, a data analysis notebook, or an automation script. Be ready to explain it; see how to explain your college project.
- Practise problem solving in Python: write short programs daily using loops, slicing and comprehensions.
- Prepare for timed rounds with how to prepare for online coding tests.
- Check your overall readiness with the free IT Internship Readiness Test.
More free interview questions tests
- .NET interview questions test: C#, OOP, LINQ, async and ASP.NET Core
- Java interview questions test: OOP, strings, collections, exceptions and Java 8
- SQL interview questions test: joins, GROUP BY, keys, subqueries and transactions
- React interview questions test: JSX, props, state, hooks and rendering
- Angular interview questions test: components, data binding, services, routing and RxJS
- Azure interview questions test: cloud concepts, compute, storage, networking and security
- DevOps interview questions test: Git, Linux, CI/CD, Docker and Kubernetes
See all tests and which ones fit your target role on the free internship tests page.
Frequently asked questions
Is this Python interview test free?
Yes. The test is completely free, needs no login, and does not ask for any personal details. Your best score is saved only in your own browser.
How many questions are in the Python test?
Each attempt has 15 random multiple-choice questions, balanced across seven topics. The questions and answer options are shuffled, so every retake gives you a new test.
What level is this Python test?
It is designed for freshers and internship candidates. It checks the Python fundamentals interviewers commonly ask about, not advanced or certification-level topics.
Which version of Python does the test cover?
The questions are based on Python 3, which is the current version used in companies and colleges. Python 2 is no longer supported.
Does a high score guarantee an internship?
No. A high score shows strong fundamentals, but interviews also check your projects, problem solving, and communication. Use your result to decide what to study next.
Your next step
Scored well? Learn what happens in each internship interview round, from the online test to the HR interview.
Read the interview guide