Python MCQs with answers Page - 31

Here, you will find a collection of MCQ questions on Python. Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

A

Admin • 832.27K Points
Coach

Q. To write else statement in if-elif ladder is mandatory? (T/F)

  • (A) True
  • (B) False
  • (C) ---
  • (D) ---

A

Admin • 832.27K Points
Coach

Q. Number of elif in if-elif ladder depends on ____

  • (A) number of conditions to be checked in program.
  • (B) number of variables in program.
  • (C) Both of the above
  • (D) None of the above

A

Admin • 832.27K Points
Coach

Q. A graphical representation that shows step by step solution to solve a given problem is ____________

  • (A) Algorithm
  • (B) Flow Chart
  • (C) Line Chart
  • (D) Pie Chart

A

Admin • 832.27K Points
Coach

Q. Which of the following is not a keyword in Python?

  • (A) True
  • (B) False
  • (C) if
  • (D) For

A

Admin • 832.27K Points
Coach

Q. Which of the following is not a conditional statement in Python?

  • (A) if statement
  • (B) if – else statement
  • (C) if – elif statement
  • (D) None of the above

A

Admin • 832.27K Points
Coach

Q. Which of the following symbol is used to end an ‘if’ statement in Python?

  • (A) Comma( , )
  • (B) Colon( : )
  • (C) Semi Colon( ; )
  • (D) None of the above

A

Admin • 832.27K Points
Coach

Q. Write the output of the following :

Code:
x = 10
if x > 7 and x <= 10:
 print("Pass", end="")
 print("Fail")
  • (A) Pass
  • (B) Fail
  • (C) Pass Fail
  • (D) PassFail

A

Admin • 832.27K Points
Coach

Q. Which of the following value of ‘x’ makes the condition False in the given code?

Code:
if (x > 7 or x == 3) and x!=11 :
 print("H")
  • (A) 8
  • (B) 9
  • (C) 5
  • (D) 33

A

Admin • 832.27K Points
Coach

Q. Write the output of the following:

Code:
if (3+8//2 != 7):
 print("H")
else:
 print("B")
  • (A) H
  • (B) B
  • (C) Error
  • (D) None of the above

A

Admin • 832.27K Points
Coach

Q. Write the output of the following:

Code:
a=5
b=6
c=7
d=8
if a > b:
    if c > a:
        if d < c:
             print("Hello")
        else:
             print("B")
    else:
           print("A")
print("What")
  • (A) What
  • (B) Hello
  • (C) B
  • (D) A

Add MCQ in this Category

If you want to share an MCQ question in this category, it's a great idea! It will be helpful for many other students using this website.

Share Your MCQ