31st
Jan
Python MCQ

Python MCQ

  • Admin
  • 31st Jan, 2023
  • 693 Followers

Take Python MCQ Online Test to Test Your Knowledge 

Practice here the best Python MCQ Questions, that checks your basic knowledge of Python Programming. This Python MCQ Online Test Contains 30+ best Multiple Choice Questions. These Python MCQs are very popular & asked various times in Python Exam/Interviews. finally, you have to select the right option for every question to check your final preparation. apart from this, you can also download below the Python MCQ PDF, completely free.

Python MCQ

1) Which of the following is the use of id() function in python?

  • A. Every object doesn’t have a unique id
  • B.Id returns the identity of the object
  • C.All of the mentioned
  • D.None of the mentioned

2) Is Python case sensitive when dealing with identifiers?

  • A. yes
  • B.no

3) All keywords in Python are written in ..................

  • A. UPPER CASE
  • B.lower case
  • C.Capitalized
  • D.None of the mentioned

4) Mathematical operations can be performed on a string. State whether true or false -

  • A. False
  • B.True

5) Which one of the following has the highest precedence in the expression?

  • A. Addition
  • B.Multiplication
  • C.Exponential
  • D.Parentheses
Download Free : Python MCQ PDF

6) What is the return type of function id?

  • A. float
  • B.bool
  • C.dict
  • D.int

7) What is the output of the following code?

  • A. Hello ‘foo’ and foo
  • B.Hello foo and foo
  • C.Hello foo and ‘bin’
  • D.Error

8) Which of the following data types is not supported in python?

  • A. String
  • B.Numbers
  • C.Slice
  • D.List

9) Which of the following keywords mark the beginning of the class definition?

  • A. return
  • B.class
  • C.def
  • D.All of the above

10) Select the reserved keyword in python.

  • A. else
  • B.raise
  • C.import
  • D.All of the above

11) Are nested if-else are allowed in Python?

  • A. Yes
  • B.No

12) Python allows string slicing. What is the output of the code given below?

  • A. buzzc
  • B.pbuzz
  • C.bu
  • D.None of these

13) What is the output of the following python code?

  • A. Bye World
  • B.Hello World
  • C.Compilation Error
  • D.Ambiguity

14) The format function, when applied on a string returns :

  • A. list
  • B.bool
  • C.int
  • D.str

15) Which of the following statement is correct?

  • A. List is mutable & Tuple is immutable
  • B.List is immutable & Tuple is mutable
  • C.Both are Mutable.
  • D.Both are Immutable

16) What is the maximum possible length of an identifier in python?

  • A. 32 characters
  • B.63 characters
  • C.79 characters
  • D.31 Characters

17) Which one of the following is not a python's predefined data type?

  • A. List
  • B.Dictionary
  • C.Tuple
  • D.Class

18) What will be the output of 7^10 in python?

  • A. 13
  • B.15
  • C.2
  • D.None of these

19) What is the ouput of 19 % 2 in python?

  • A. 2
  • B.17
  • C.Zero
  • D.None of the above

20) Which of the following has more precedence?

  • A. /
  • B.+
  • C.()
  • D.-

21) Does tuple mutable in python?

  • A. Yes
  • B.No

22) Which of the following is a Python tuple?

  • A. [3]
  • B.{1, 2, 3}
  • C.(1, 2, 3, 4)
  • D.None of the Above

23) Which of the following is not a declaration of the dictionary?

  • A. {1: 'A', 2: 'B'}
  • B.{1, "A", 2"B"}
  • C.dict([[1, "A"],[2,"B"]])
  • D.{}

24) Which of the following refers to mathematical function?

  • A. sqrt
  • B.add
  • C.rhombus
  • D.None of the above

25) What will be the output of the following Python code?

  • A. 26
  • B.125
  • C.525
  • D.None of above

26) Which one of these is floor division?

  • A. /
  • B.//
  • C.%
  • D.$

27) Does python allow us to assign a single value to multiple variables simultaneously?

  • A. True
  • B.False

28) In python programming, pass is a null statement.

  • A. Yes
  • B.No

29) What will be the output of the following Python code?

  • A. 1
  • B.1 2 5 8 9
  • C.1 3 5 7 9 11
  • D.None of above

30) Which symbol is used to test condition in a flow chart?

  • A. Terminal
  • B.Process
  • C.Diamond
  • D.Input/Output

Leave A Comment :

Valid name is required.

Valid name is required.

Valid email id is required.

Related MCQ/Quiz

01st
Feb
DBMS MCQ
01st
May
Powerpoint MCQ
01st
Jun
Hadoop MCQ
01st
Feb
OOPs MCQ