Top 110 Python MCQ Questions with Answers for Practice (2026)

10 Python MCQs with Answers (Beginner to Advanced)


🟢 Beginner Level (1–40)

1. Python is a:

A) Compiled language
B) Interpreted language
C) Assembly language
D) Machine language
Answer: B


2. Which symbol is used for comments?

A) //
B) <!– –>
C) #
D) /* */
Answer: C


3. What is the output of print(type(5))?

A) int
B) <class ‘int’>
C) number
D) integer
Answer: B


4. Which keyword defines a function?

A) func
B) define
C) def
D) function
Answer: C


5. What is the output of 5 // 2?

A) 2.5
B) 3
C) 2
D) 2.0
Answer: C


6. Which data type is mutable?

A) Tuple
B) String
C) List
D) Integer
Answer: C


7. What is the output of len("Python")?

A) 5
B) 6
C) 7
D) Error
Answer: B


8. Which keyword is used for loops?

A) repeat
B) loop
C) for
D) iterate
Answer: C


9. Which operator is used for multiplication?

A) x
B) *
C) %
D) #
Answer: B


10. What is the output of 2**3?

A) 6
B) 8
C) 9
D) 5
Answer: B


11. What is the output of 10 % 3?

A) 3
B) 1
C) 0
D) 10
Answer: B


12. Which of these is a string?

A) 123
B) “123”
C) 12.3
D) True
Answer: B


13. Which function is used for input?

A) get()
B) read()
C) input()
D) scan()
Answer: C


14. Which keyword is used for conditional statements?

A) if
B) check
C) when
D) case
Answer: A


15. What is the output of print(bool(1))?

A) False
B) True
C) None
D) Error
Answer: B


16. Which data type is immutable?

A) List
B) Dictionary
C) Tuple
D) Set
Answer: C


17. Which function converts string to integer?

A) str()
B) int()
C) float()
D) chr()
Answer: B


18. What is the output of "Hi" * 2?

A) HiHi
B) Hi 2
C) Error
D) HiHiHi
Answer: A


19. Which symbol is used for assignment?

A) ==
B) =
C) !=
D) :=
Answer: B


20. What is the output of 3 > 2?

A) True
B) False
C) Error
D) None
Answer: A


21. Which is a valid variable name?

A) 1name
B) name_1
C) name-1
D) name 1
Answer: B


22. What is the output of len([1,2,3])?

A) 2
B) 3
C) 1
D) Error
Answer: B


23. Which of these is a list?

A) (1,2,3)
B) [1,2,3]
C) {1,2,3}
D) “123”
Answer: B


24. Which of these is a dictionary?

A) [1,2]
B) {1,2}
C) {“a”:1}
D) (1,2)
Answer: C


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

A) list
B) tuple
C) dict
D) set
Answer: A


26. Which function prints output?

A) echo()
B) print()
C) output()
D) show()
Answer: B


27. Which keyword exits loop?

A) stop
B) break
C) exit
D) return
Answer: B


28. Which keyword skips iteration?

A) skip
B) continue
C) pass
D) next
Answer: B


29. What is the output of 4 == 4.0?

A) True
B) False
C) Error
D) None
Answer: A


30. Which function gives length?

A) size()
B) count()
C) len()
D) length()
Answer: C


31–40 (concise to keep readable)

  1. bool("")B False
  2. int("5")A 5
  3. 3+2*2B 7
  4. 10/2A 5.0
  5. "a"+"b"A ab
  6. min(1,2)A 1
  7. max(1,2)B 2
  8. abs(-5)A 5
  9. round(2.6)B 3
  10. type({})C dict

🟡 Intermediate Level (41–80)

  1. append() → B add end
  2. pop() → A remove element
  3. sort() → C sort list
  4. len("Hi")B 2
  5. 10//3B 3
  6. strip() → A remove spaces
  7. replace() → B replace text
  8. split() → C split string
  9. join() → A join list
  10. keys() → A dict keys
  11. values() → B dict values
  12. items() → C key-value pairs
  13. inA membership operator
  14. isB identity operator
  15. lambda → C anonymous function
  16. map() → B apply function
  17. filter() → C filter items
  18. reduce() → A cumulative result
  19. range(3) → B 0,1,2
  20. enumerate() → A index + value
  21. zip() → B combine iterables
  22. open() → A open file
  23. read() → B read file
  24. write() → C write file
  25. close() → A close file
  26. try → A exception block
  27. except → B catch error
  28. finally → C always run
  29. raise → A throw error
  30. assert → B debug check

71–80 (short):
71. global → A global var
72. nonlocal → B outer var
73. dir() → A list attributes
74. help() → B documentation
75. id() → C memory id
76. type() → A type check
77. isinstance() → B type check
78. sorted() → A sorted list
79. reversed() → B reverse iterator
80. sum([1,2]) → A 3


🔵 Advanced Level (81–110)

  1. generator → B yield function
  2. yield → A return generator value
  3. decorator → C modify function
  4. @staticmethodA static method
  5. @classmethodB class method
  6. __init__A constructor
  7. __str__B string representation
  8. __len__C length override
  9. __del__A destructor
  10. inheritance → B reuse class
  11. polymorphism → A many forms
  12. encapsulation → B data hiding
  13. abstraction → C hide complexity
  14. threading → A parallel tasks
  15. multiprocessing → B multi CPU
  16. GIL → A global interpreter lock
  17. list comprehension → B compact loop
  18. dict comprehension → C dict creation
  19. set comprehension → A set creation
  20. frozensetB immutable set
  21. collectionsA advanced DS
  22. itertoolsB iterator tools
  23. functoolsC function tools
  24. sysA system functions
  25. osB OS interaction
  26. virtualenv → A env isolation
  27. pip → B package manager
  28. wheel → C package format
  29. docstring → A documentation
  30. PEP → B Python standards