Python Certification Exam Preparation Set 36

Assuming that the V variable holds an integer value to 2, which of the following operators should be used instead of OPER to make the expression equal to 1?

V OPER 1 -


Options are :

  • <<<
  • >>>
  • >> (Correct)
  • <<

Answer :>>

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

UNICODE is:


Options are :

  • the name of an operating system
  • a standard for encoding and handling texts (Correct)
  • the name of a programming language
  • the name of a text processor

Answer :a standard for encoding and handling texts

Is Python case sensitive when dealing with identifiers?


Options are :

  • yes (Correct)
  • no
  • machine dependent
  • none of the mentioned

Answer :yes

Python Certification Exam Preparation Set 39

Which of the following is true for variable names in Python?


Options are :

  • all private members must have leading and trailing underscores
  • unlimited length (Correct)
  • none of the mentioned
  • underscore and ampersand are the only two special characters allowed

Answer :unlimited length

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



Options are :

  • Multiplication
  • Parentheses (Correct)
  • Exponential
  • Addition

Answer :Parentheses

Which of the following cannot be a variable?


Options are :

  • in (Correct)
  • it
  • on
  • __init__

Answer :in

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

It is not possible for the two's complement value to be equal to the original value in any case. 


Options are :

  • False (Correct)
  • True

Answer :False

What will be the output of the following Python expression?


Options are :

  • 8 (Correct)
  • 12
  • 4
  • 2

Answer :8

Which of the following is an invalid variable? 


Options are :

  • 1st_string (Correct)
  • _
  • my_string_1
  • foo

Answer :1st_string

Python Certification Exam Preparation Set 29

The expression Int(x) implies that the variable x is converted to integer.


Options are :

  • True (Correct)
  • False

Answer :True

Any odd number on being AND-ed with ________ always gives 1. Hint: Any even number on being AND-ed with this value always gives 0. 


Options are :

  • 2
  • 0
  • 1 (Correct)
  • 10

Answer :1

Which of the following is not a keyword? 


Options are :

  • pass
  • nonlocal
  • eval (Correct)
  • assert

Answer :eval

Python Certification Exam Preparation Set 38

What will be the output of the following Python expression if x=15 and y=12?


Options are :

  • 1101
  • 0b1101
  • 12 (Correct)
  • b1101

Answer :12

All keywords in Python are in _________ 


Options are :

  • UPPER CASE
  • None of the mentioned (Correct)
  • lower case
  • Capitalized

Answer :None of the mentioned

Which is the correct operator for power(X to the power y)


Options are :

  • X^^y
  • X**y (Correct)
  • X^y
  • None of the mentioned

Answer :X**y

Python Certification Exam Preparation Set 21

Bitwise _________ gives 1 if either of the bits is 1 and 0 when both of the bits are 1.


Options are :

  • OR
  • NOT
  • XOR (Correct)
  • AND

Answer :XOR

What is the maximum possible length of an identifier?


Options are :

  • none of the mentioned (Correct)
  • 79 characters
  • 31 characters
  • 63 characters

Answer :none of the mentioned

What will be the output of the following Python expression?


Options are :

  • '0b10111'
  • '0b11101' (Correct)
  • '0b11111'
  • '0b11011'

Answer :'0b11101'

Python Certification Exam Preparation Set 42

The following is displayed by a print function call. Select all of the function calls that result in this output.


Options are :

  • print('tom John harry')
  • print('''tom \njohn \nharry''')
  • print("'tomJohnharry"')
  • print('tom\nJohn\nharry') (Correct)

Answer :print('tom\nJohn\nharry')

Which of the following is an invalid statement? 


Options are :

  • a b c = 1000 2000 3000 (Correct)
  • a_b_c = 1,000,000
  • a,b,c = 1000, 2000, 3000
  • abc = 1,000,000

Answer :a b c = 1000 2000 3000

What is the order of precedence in python?

i) Parentheses

ii) Exponential

iii) Multiplication

iv) Division

v) Addition

vi) Subtraction


Options are :

  • i,ii,iii,iv,vi,v
  • ii,i,iii,iv,v,vi
  • ii,i,iv,iii,v,vi
  • i,ii,iii,iv,v,vi (Correct)

Answer :i,ii,iii,iv,v,vi

Python Certification Exam Preparation Set 30

Which one of the following has the same precedence level?


Options are :

  • Addition and Multiplication
  • Multiplication, Division, Addition and Subtraction
  • Multiplication, Division and Addition
  • Addition and Subtraction (Correct)

Answer :Addition and Subtraction

What is the answer to this expression, 22 % 3 is?


Options are :

  • 1 (Correct)
  • 0
  • 7
  • 5

Answer :1

Which of the following is invalid? 


Options are :

  • __str__ = 1
  • __a = 1
  • _a = 1
  • none of the mentioned (Correct)

Answer :none of the mentioned

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

What will be the output of the following Python code snippet if x=1?


Options are :

  • 4 (Correct)
  • 8
  • 2
  • 1

Answer :4

Operators with the same precedence are evaluated in which manner?


Options are :

  • None of the mentioned
  • Can't say
  • Left to Right (Correct)
  • Right to Left

Answer :Left to Right

Which one of these is floor division?


Options are :

  • None of the mentioned
  • // (Correct)
  • /
  • %

Answer ://

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

Mathematical operations can be performed on a string.


Options are :

  • True
  • False (Correct)

Answer :False

What will be the value of x in the following Python expression, if the result of that expression is 2?


Options are :

  • 2
  • 1
  • 8 (Correct)
  • 4

Answer :8

Which of the following represents the bitwise XOR operator? 


Options are :

  • |
  • !
  • ^ (Correct)
  • &

Answer :^

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

Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions