Python Certification Exam Preparation Set 12

Operator '//=' and '**=' are


Options are :

  • Comaprision operators
  • Assignment operators (Correct)
  • Equality operators
  • They both are not valid Python Operators.

Answer :Assignment operators

If the else statement is used with a while loop, the else statement is executed when the


Options are :

  • after every iteration
  • while loop is not run even once.
  • condition becomes false (Correct)
  • condition becomes true

Answer :condition becomes false

Python Certification Exam Preparation Set 26

To check if all characters In a string are alphanumeric which of the following method can be invoked on string:


Options are :

  • isalnum() (Correct)
  • isalphanumeric()
  • isalpha()
  • isnumeric()

Answer :isalnum()

Minimum number of time a while loop can run are


Options are :

  • 2
  • 9
  • 1
  • 0 (Correct)

Answer :0

What is the output of {print str * 2} if str = 'Hello World!'?


Options are :

  • HHeelllloo Wwoorrlldd!!
  • Hello World!*2
  • Hello World!Hello World! (Correct)
  • TypeError: Can't convert 'int' object to str implicitly

Answer :Hello World!Hello World!

Python Practice Test MCQ Certified Go from 0 to Expert hero Set 19

Which statement in loops, Causes the loop to skip the remainder of its body and immediately retest its condition prior to reiterating.


Options are :

  • break statement
  • pass statement
  • None of these
  • continue statement (Correct)

Answer :continue statement

Complex numbers have a real and imaginary part. In Python, these parts are represented by _____ and _____ respectively.


Options are :

  • integer, float
  • integer, integer
  • float, float (Correct)
  • float, integer

Answer :float, float

What will be the output of print(["\u00B2".isdecimal(),"\u00B2".isnumeric()])


Options are :

  • [False, True] (Correct)
  • [True, True]
  • [False, False]
  • [True, False]

Answer :[False, True]

Python Certification Exam Preparation Set 28

For loops in python supports Iterating by Sequence Indexing


Options are :

  • TRUE (Correct)
  • FALSE

Answer :TRUE

In Python3, Integers have how much precision?


Options are :

  • unlimited (Correct)
  • 16-bit
  • 32-bit
  • 64-bit

Answer :unlimited

Which statement in loops, Terminates the loop statement and transfers execution to the statement immediately following the loop.


Options are :

  • None of these
  • continue statement
  • pass statement
  • break statement (Correct)

Answer :break statement

Python Practice Test MCQ Certified Go from 0 to Expert hero Set 22

Python has how many "standard data types" ?


Options are :

  • 5 (Correct)
  • 6
  • 8
  • 2

Answer :5

Python Descision Statements can evaluate how many expressions to produce TRUE or FALSE as outcome.


Options are :

  • 1
  • multiple (Correct)
  • 2, with and '&' or '|' operator in between them
  • multiple but with and '&' or '|' operator in between them, only

Answer :multiple

Python supports switch-case statemetns.


Options are :

  • TRUE
  • FALSE (Correct)

Answer :FALSE

Python Certification Exam Preparation Set 11

What is the output of following code {a="b"; [a is "a", a is not "a"}


Options are :

  • [True, False]
  • [False, False]
  • [False, True] (Correct)
  • [True, True]

Answer :[False, True]

What's the difference between index() and find() method on a string?


Options are :

  • find() is same as index() but raises and exception if str is not found.
  • find() in Python2 is replaced by index() in Python3.
  • index() is same as find() but raises and exception if str is not found. (Correct)
  • They both are same.

Answer :index() is same as find() but raises and exception if str is not found.

In Following Python expression { 4 + 5 = 9 }; what do you call '4','5' and '+' ?


Options are :

  • They all are Operators
  • operands, operator (Correct)
  • operator, operands
  • They all are Operands

Answer :operands, operator

Python Practice Test MCQ Certified Go from 0 to Expert hero Set 11

1. Choose the correct output of the following code:-


Options are :

  • Syntax Error
  • -10
  • Type Error (Correct)
  • Value Error

Answer :Type Error

Python Practice Test MCQ Certified Go from 0 to Expert hero Set 18

2. Choose the correct output of the following code:-


Options are :

  • (Correct)
  • Error

Answer :

3. Choose the correct output of the following code:-


Options are :

  • 13
  • No Output (Correct)
  • 12
  • 14

Answer :No Output

4. Choose the correct output of the following code:-


Options are :

  • 13 (Correct)
  • Error
  • 12
  • 14

Answer :13

Python Practice Test MCQ Certified Go from 0 to Expert hero Set 28

5. Which among the following line of code will raise an error?


Options are :

  • line1
  • line2
  • line3
  • line4 (Correct)
  • line5
  • line6

Answer :line4

6. Choose the correct output of the following code:-


Options are :

  • 904.31
  • 523.33
  • Error (Correct)
  • 267.94

Answer :Error

7. Choose the correct output of the following code:-


Options are :

  • 65 66 66 67 67 67 68 68 68 68 69 69 69 69 69
  • A B C D E F G H I J K L M N O
  • A B B C C C D D D D E E E E E (Correct)
  • 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79

Answer :A B B C C C D D D D E E E E E

Python Certification Exam Preparation Set 54

8. What will be the text shown in the sys.txt file after the execution of the following code:-

UNICODE Code point:-

J -> 74

A -> 65

V -> 86

A -> 65 


Options are :

  • The file will contain no text.
  • 74 65 86 65
  • JAVA (Correct)
  • 0b1001010 0b1000001 0b1010110 0b1000001

Answer :JAVA

9. Consider that the below code is written inside test.py file.

Choose the correct output of the above code:-


Options are :

  • __name__
  • __main__ (Correct)
  • None
  • None
  • test
  • Error as __name__ variable is not defined

Answer :__main__

10. Choose the correct output of the following code:-


Options are :

  • 1 2 3 (Correct)
  • First Second Third
  • (1, 'First') (2, 'Second') (3, 'Third')
  • Error

Answer :1 2 3

Python Certification Exam Preparation Set 27

11. Choose the correct output of the following code:-


Options are :

  • 1 2 3
  • First Second Third
  • (1, 'First') (2, 'Second') (3, 'Third') (Correct)
  • Error

Answer :(1, 'First') (2, 'Second') (3, 'Third')

12. Consider that the below code is written inside test1.py file.

Consider that the below code is written inside test2.py file.

Choose the correct output when the test2.py file is executed.


Options are :

  • print of test1: test1 print of test2: __main__ (Correct)
  • print of test1: __main__ print of test2: __main__
  • print of test1: None print of test2: None
  • Error as __name__ variable is not defied
  • print of test1: test1 print of test2: test2
  • print of test1: test1
  • print of test1: __main__

Answer :print of test1: test1 print of test2: __main__

13. Choose the correct output of the following code:-


Options are :

  • 24
  • Type Error (Correct)
  • Name Error
  • Value Error

Answer :Type Error

Python Practice Test MCQ Certified Go from 0 to Expert hero Set 32

Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions