Top 50 Python MCQ Questions and Answers for Exams & Interviews

0

Top 50 Python MCQ Questions with Answers (Exam Ready)

This post contains important Python multiple choice questions for exams, interviews, and quick revision.




1) What is Python?

A) Low-level language
B) High-level language
C) Machine language
D) Assembly language

Answer: B) High-level language


2) Who developed Python?

A) Dennis Ritchie
B) James Gosling
C) Guido van Rossum
D) Bjarne Stroustrup

Answer: C) Guido van Rossum


3) Which symbol is used for comments?

A) //
B) #
C) /* */
D) --

Answer: B) #


4) Which data type is immutable?

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

Answer: C) Tuple


5) Which keyword is used to define function?

A) function
B) def
C) fun
D) define

Answer: B) def


6) What is output of print(2+3)?

A) 23
B) 5
C) Error
D) None

Answer: B) 5


7) Which data type stores key-value pairs?

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

Answer: C) Dictionary


8) Which operator is used for exponent?

A) ^
B) **
C) *
D) //

Answer: B) **


9) What is type of "Hello"?

A) int
B) float
C) string
D) list

Answer: C) string


10) Which function is used to take input?

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

Answer: B) input()


11) Which loop is used for iteration?

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

Answer: A) for


12) Which symbol is used for list?

A) ()
B) []
C) {}
D) <>

Answer: B) []


13) Which keyword is used for condition?

A) if
B) loop
C) def
D) class

Answer: A) if


14) Which is not a data type?

A) int
B) float
C) char
D) list

Answer: C) char


15) Which keyword stops loop?

A) stop
B) break
C) end
D) exit

Answer: B) break


16) What is output of print(10//3)?

A) 3
B) 3.3
C) 4
D) Error

Answer: A) 3


17) Which data type allows duplicates?

A) set
B) list
C) tuple
D) both B and C

Answer: D) both B and C


18) Which function gives length?

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

Answer: B) len()


19) Which operator is comparison?

A) +
B) -
C) ==
D) *

Answer: C) ==


20) Which keyword is used for class?

A) object
B) class
C) def
D) new

Answer: B) class


21) Which function prints output?

A) show()
B) print()
C) output()
D) display()

Answer: B) print()


22) Which symbol is used for dictionary?

A) []
B) {}
C) ()
D) <>

Answer: B) {}


23) Which keyword is used for exception?

A) try
B) catch
C) error
D) handle

Answer: A) try


24) Which block handles error?

A) try
B) except
C) finally
D) error

Answer: B) except


25) Which keyword skips loop iteration?

A) break
B) skip
C) continue
D) pass

Answer: C) continue


26) Which is mutable?

A) tuple
B) string
C) list
D) int

Answer: C) list


27) Which is immutable?

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

Answer: C) tuple


28) What is output of print(5*2)?

A) 10
B) 52
C) 7
D) Error

Answer: A) 10


29) Which keyword defines loop condition?

A) if
B) for
C) while
D) def

Answer: C) while


30) Which data type is unordered?

A) list
B) tuple
C) set
D) string

Answer: C) set


31) Which keyword ends function?

A) end
B) return
C) stop
D) exit

Answer: B) return


32) Which is used to import module?

A) include
B) import
C) using
D) add

Answer: B) import


33) Which keyword is used for lambda?

A) lam
B) lambda
C) func
D) def

Answer: B) lambda


34) Which method adds element to list?

A) add()
B) append()
C) insert()
D) push()

Answer: B) append()


35) Which removes element?

A) delete()
B) remove()
C) pop()
D) both B and C

Answer: D) both B and C


36) Which keyword is used for loop control?

A) break
B) continue
C) pass
D) all

Answer: D) all


37) What is output of print(3>2)?

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

Answer: A) True


38) Which type stores unique values?

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

Answer: C) set


39) Which keyword creates object?

A) new
B) class
C) object
D) none

Answer: A) new


40) Which keyword is used for inheritance?

A) extend
B) inherit
C) class
D) none

Answer: C) class


41) Which keyword defines global variable?

A) global
B) var
C) static
D) public

Answer: A) global


42) Which function converts to int?

A) int()
B) str()
C) float()
D) convert()

Answer: A) int()


43) Which function converts to string?

A) int()
B) str()
C) float()
D) convert()

Answer: B) str()


44) Which operator is floor division?

A) /
B) //
C) %
D) *

Answer: B) //


45) Which keyword defines exception?

A) error
B) except
C) catch
D) handle

Answer: B) except


46) Which block always executes?

A) try
B) except
C) finally
D) error

Answer: C) finally


47) Which is logical operator?

A) and
B) or
C) not
D) all

Answer: D) all


48) Which keyword defines local variable?

A) local
B) var
C) none
D) inside function

Answer: D) inside function


49) Which function reads file?

A) read()
B) open()
C) write()
D) file()

Answer: A) read()


50) Why Python is easy?

A) complex syntax
B) readable syntax
C) low-level
D) none

Answer: B) readable syntax


Perfect for exams, viva, and interview preparation.

Post a Comment

0Comments

Please Select Embedded Mode To show the Comment System.*