Are you new to Python programming and want to test your skills? This Python quiz for beginners is the perfect way to evaluate what you’ve learned so far. Python is one of the most popular and beginner-friendly programming languages. But learning isn’t complete until you practice—and that’s exactly what this quiz is for!
Whether you’re a student, a coding bootcamp participant, or a self-taught learner, this beginner-friendly quiz will challenge your understanding of core Python concepts.
Let’s dive in!
🧠 Python Quiz for Beginners – Instructions
- Total Questions: 15
- Difficulty: Easy to Medium
- Format: Multiple Choice Questions (MCQs)
- Time Limit: 10–15 minutes (optional)
🔤 1. Python Basics
Q1. What is the correct file extension for Python files?
A) .pt
B) .py ✔️
C) .pyt
D) .pyth
Q2. What is the output of print(2 * 3 + 5)
?
A) 16
B) 11 ✔️
C) 13
D) 10
Q3. Which keyword is used to create a function in Python?
A) function
B) define
C) def ✔️
D) func
🔁 2. Control Flow and Loops
Q4. Which of these is a valid Python loop?
A) while loop ✔️
B) do-while loop
C) repeat-until
D) for-each
Q5. What is the output of the following code?
pythonCopyEditfor i in range(3):
print(i)
A) 1 2 3
B) 0 1 2 ✔️
C) 0 1 2 3
D) Error
Q6. Which keyword is used to skip an iteration in a loop?
A) exit
B) break
C) continue ✔️
D) pass
🧮 3. Variables and Data Types
Q7. Which of the following is a valid variable name?
A) 1st_number
B) firstNumber ✔️
C) first-number
D) @number
Q8. What data type is the result of input()
by default?
A) int
B) float
C) string ✔️
D) bool
Q9. What is the output of type(5.0)
?
A) <class 'int'>
B) <class 'float'>
✔️
C) <class 'double'>
D) <class 'str'>
📦 4. Functions and Modules
Q10. What is the purpose of the return
statement in a function?
A) Ends the function
B) Returns a value ✔️
C) Prints the result
D) Calls another function
Q11. Which of the following imports the math
module in Python?
A) use math
B) include math
C) import math ✔️
D) using math
Q12. What is the correct syntax to define a function named greet
?
pythonCopyEditA) function greet():
B) def greet() ✔️
C) define greet():
D) func greet():
📌 5. Lists and Dictionaries
Q13. What is the output of this code?
pythonCopyEditfruits = ["apple", "banana", "cherry"]
print(fruits[1])
A) apple
B) banana ✔️
C) cherry
D) Error
Q14. How do you access a value in a dictionary?
A) Using dot notation
B) Using the value name
C) Using the key ✔️
D) Using the index
Q15. What does list.append(x)
do?
A) Removes x from the list
B) Inserts x at the beginning
C) Adds x to the end ✔️
D) Sorts the list
📝 Your Score:
- 13–15 correct: You’re ready to build Python projects! 🚀
- 9–12 correct: Great! Keep practicing. 🔄
- 5–8 correct: You’re getting there. Time to revise! 🧠
- 0–4 correct: Start with Python basics and try again. 📘
💡 Why Take a Python Quiz as a Beginner?
- Reinforces what you’ve learned
- Identifies gaps in knowledge
- Prepares you for interviews
- Makes learning fun and interactive
❓ FAQs: Python Quiz for Beginners
Q1. Is this Python quiz suitable for complete beginners?
Yes! The quiz covers basic topics like variables, loops, functions, and data types.
Q2. Do I need to install Python to take this quiz?
No. This quiz can be taken online without running code, though testing in an IDE is recommended.
Q3. How can I improve my Python after taking this quiz?
Try building small projects, reading beginner books, and taking more quizzes to practice.
Q4. Can I use this Python quiz in my classroom or website?
Yes! Feel free to share it with students or embed it on educational platforms.