PYnative

Python Programming

  • Learn Python
    • Python Tutorials
    • Python Basics
    • Python Interview Q&As
  • Exercises
    • Python Exercises
    • C Programming Exercises
    • C++ Exercises
  • Quizzes
  • Code Editor
    • Online Python Code Editor
    • Online C Compiler
    • Online C++ Compiler
Home » Python » Quizzes » Basic Python Quiz For Beginners

Basic Python Quiz For Beginners

Updated on: September 3, 2025 | 149 Comments

This Quiz is for beginners who are new to Python Programming. This quiz provides Multiple Choice Questions(MCQs) to get familiar with Python. The quiz focuses on testing your basic skills in Python functions, string, operators, functions, set, and lists.

The quiz contains 25 Questions. Solve 15 correct to pass the test.

  • Read Python Basics to solve this quiz.
  • Solve Python MCQ Test
  • Also, Solve Python Basic Exercise for Beginners.
  • 15 Python Quizzes: each focusing on a specific topic

1. What is the output of the following code?

var= "James Bond"
print(var[2::-1])
 
 
 
 

2. What is the output of the following code?

sampleSet = {"Jodi", "Eric", "Garry"}
sampleSet.add(1, "Vicki")
print(sampleSet)
 
 
 

3. What is the output of the following code?

var = "James" * 2  * 3
print(var)
 
 
 

4. Which of the following data types is mutable in Python?

 
 
 
 

5. Which of the following data types is mutable in Python?

 
 
 
 

6. What is the output of the following code?

listOne = [20, 40, 60, 80]
listTwo = [20, 40, 60, 80]

print(listOne == listTwo)
print(listOne is listTwo)
 
 
 

7. What is the output of print(type([]))?

 
 
 
 

8. What is the purpose of the if __name__ == "__main__": block?

 
 
 
 

9. What is the output of the following code?

result = True and False
print(result)
 
 
 
 

10. What is the purpose of the pass statement in Python?

 
 
 
 

11. What is the purpose of self in a Python class method?

 
 
 
 

12. What is the output of the following code?

for i in range(10, 15, 1):
  print( i, end=', ')

Hint: Python range function

 
 

13. What is a “tuple” in Python?

 
 
 
 

14. How do you remove an item from a dictionary with a specific key key_name?

 
 
 
 

15. What is the output of the following code?

p, q, r = 10, 20 ,30
print(p, q, r)
 
 
 

16. What is the correct operator for exponentiation in Python?

 
 
 
 

17. What is the Output of the following code?

for x in range(0.5, 5.5, 0.5):
  print(x)
 
 
 

18. What is the output of print(10 // 3)

 
 
 
 

19. Are the statements below true or false?

  • Strings are immutable in Python.
  • Every time we modify a string, Python always creates a new string and assigns it to that variable.
 
 

20. What is the output of the following code?

x = 10
y = 3
print(x % y)
 
 
 
 

21. What is the output of the following code?

str = "pynative"
print (str[1:3])
 
 
 
 

22. What is the output of the following code

salary = 8000

def printSalary():
  salary = 12000
  print("Salary:", salary)
  
printSalary()
print("Salary:", salary)
 
 
 

23. What is the output of the following code?

my_list = [1, 2, 3, 4]
print(my_list[2])
 
 
 
 

24. What is the output of the following code?

def calculate (num1, num2=4):
  res = num1 * num2
  print(res)

calculate(5, 6)

Hint: functions in Python

 
 
 

25. What is the output of the following code?

a = [1, 2, 3]
b = a
b.append(4)
print(a)
 
 
 
 

Loading ... Loading …

Loading

Filed Under: Python, Python Basics, Python Quizzes

Did you find this page helpful? Let others know about it. Sharing helps me continue to create free Python resources.

TweetF  sharein  shareP  Pin

About Vishal

I’m Vishal Hule, the Founder of PYnative.com. As a Python developer, I enjoy assisting students, developers, and learners. Follow me on Twitter.

Related Tutorial Topics:

Python Python Basics Python Quizzes

All Coding Exercises:

C Exercises
C++ Exercises
Python Exercises

Python Exercises and Quizzes

Free coding exercises and quizzes cover Python basics, data structure, data analytics, and more.

  • 15+ Topic-specific Exercises and Quizzes
  • Each Exercise contains 25+ questions
  • Each Quiz contains 25 MCQ
Exercises
Quizzes

Loading comments... Please wait.

In: Python Python Basics Python Quizzes
TweetF  sharein  shareP  Pin

  Python Quizzes

  • 15 Python Quizzes
  • Python Online MCQ Test
  • Basic Quiz For Beginners
  • Variables and Data Types Quiz
  • Functions Quiz
  • if else and loops Quiz
  • Numbers Quiz
  • String Quiz
  • List Quiz
  • Set Quiz
  • Dictionary Quiz
  • Tuple Quiz
  • Operators and Expression Quiz
  • Input and Output Quiz
  • Multithreading and Multiprocessing Quiz
  • File Handling Quiz
  • Random Data Generation Quiz

 Explore Python

  • Python Tutorials
  • Python Exercises
  • Python Quizzes
  • Python Interview Q&A
  • Python Programs

All Python Topics

Python Basics Python Exercises Python Quizzes Python Interview Python File Handling Python OOP Python Date and Time Python Random Python Regex Python Pandas Python Databases Python MySQL Python PostgreSQL Python SQLite Python JSON

About PYnative

PYnative.com is for Python lovers. Here, You can get Tutorials, Exercises, and Quizzes to practice and improve your Python skills.

Follow Us

To get New Python Tutorials, Exercises, and Quizzes

  • Twitter
  • Facebook
  • Sitemap

Explore Python

  • Learn Python
  • Python Basics
  • Python Databases
  • Python Exercises
  • Python Quizzes
  • Online Python Code Editor
  • Python Tricks

Coding Exercises

  • C Exercises
  • C++ Exercises
  • Python Exercises

Legal Stuff

  • About Us
  • Contact Us

We use cookies to improve your experience. While using PYnative, you agree to have read and accepted our:

  • Terms Of Use
  • Privacy Policy
  • Cookie Policy

Copyright © 2018–2026 pynative.com