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

What will be the output of the following Python code snippet?


Options are :

  • 1 2 3 4
  • 4 3 2 1
  • error
  • none of the mentioned

Answer :4 3 2 1

Python Certification Exam Preparation Set 38

What will be the output of the following Python code snippet?


Options are :

  • a b c d
  • d c b a
  • error
  • none of the mentioned

Answer :d c b a

What will be the output of the following Python code snippet?


Options are :

  • a b c d
  • d c b a
  • error
  • none of the mentioned

Answer :d c b a

What will be the output of the following Python code snippet?


Options are :

  • None
  • (nothing is printed)
  • error
  • none of the mentioned

Answer :(nothing is printed)

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

What will be the output of the following Python code snippet?


Options are :

  • 0 1 2 3 4 ...
  • 0 1
  • 3 4
  • 0 1 2 3

Answer :3 4

What will be the output of the following Python code snippet?


Options are :

  • 0 1 2 3 4 ...
  • 0 -2
  • 0
  • error

Answer :0 -2

What will be the output of the following Python code?


Options are :

  • 0 1 2 3 4 Here
  • 0 1 2 3 4 5 Here
  • 01 2 3 4
  • 0 1 2 3 4 5

Answer :01 2 3 4

Python Certification Exam Preparation Set 48

What will be the output of the following Python code?


Options are :

  • 0 1 2 3 4 Here
  • 0 1 2 3 4 5 Here
  • 0 1 2 3 4
  • 0 1 2 3 4 5

Answer :0 1 2 3 4 Here

What will be the output of the following Python code?


Options are :

  • 0 1 2
  • error
  • 0 1 2 0 1 2
  • none of the mentioned

Answer :0 1 2

What will be the output of the following Python code?


Options are :

  • 0 1 2
  • error
  • 0 1 2 0 1 2
  • none of the mentioned

Answer :0 1 2

Python Certification Exam Preparation Set 58

Is Python case sensitive when dealing with identifiers?


Options are :

  • yes
  • no
  • machine dependent
  • none of the mentioned

Answer :yes

Python Certification Exam Preparation Set 41

What is the maximum possible length of an identifier?


Options are :

  • 31 characters
  • 63 characters
  • 79 characters
  • none of the mentioned

Answer :none of the mentioned

Which of the following is invalid?


Options are :

  • _a = 1
  • __a = 1
  • __str__ = 1
  • none of the mentioned

Answer :none of the mentioned

Which of the following is an invalid variable?


Options are :

  • my_string_1
  • 1st_string
  • foo
  • _

Answer :1st_string

Python Certification Exam Preparation Set 25

Why are local variable names beginning with an underscore discouraged?


Options are :

  • they are used to indicate a private variables of a class
  • they confuse the interpreter
  • they are used to indicate global variables
  • they slow down execution

Answer :they are used to indicate a private variables of a class

Which of the following is not a keyword?


Options are :

  • eval
  • assert
  • nonlocal
  • pass

Answer :eval

All keywords in Python are in _________


Options are :

  • lower case
  • UPPER CASE
  • Capitalized
  • None of the mentioned

Answer :None of the mentioned

Python Certification Exam Preparation Set 56

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


Options are :

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

Answer :unlimited length

Which of the following is an invalid statement?


Options are :

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

Answer :a b c = 1000 2000 3000

Which of the following cannot be a variable?


Options are :

  • __init__
  • in
  • it
  • on

Answer :in

Python Certification Exam Preparation Set 38

Which is the correct operator for power(xy)?


Options are :

  • X^y
  • X**y
  • X^^y
  • None of the mentioned

Answer :X**y

Which one of these is floor division?


Options are :

  • /
  • //
  • %
  • None of the mentioned

Answer ://

What is the order of precedence in python?

ii) Exponential


iii) Multiplication


iv) Division


v) Addition


vi) Subtraction


Options are :

  • i,ii,iii,iv,v,vi
  • ii,i,iii,iv,v,vi
  • ii,i,iv,iii,v,vi
  • i,ii,iii,iv,vi,v

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

", $fileContentFew); $title = explode("

Python Certification Exam Preparation Set 43

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


Options are :

  • 7
  • 1
  • 0
  • 5

Answer :1

Mathematical operations can be performed on a string.


Options are :

  • True
  • False

Answer :False

Operators with the same precedence are evaluated in which manner?


Options are :

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

Answer :Left to Right

Python Certification Exam Preparation Set 49

What is the output of this expression, 3*1**3?


Options are :

  • 27
  • 9
  • 3
  • 1

Answer :3

Which one of the following has the same precedence level?


Options are :

  • Addition and Subtraction
  • Multiplication, Division and Addition
  • Multiplication, Division, Addition and Subtraction
  • Addition and Multiplication

Answer :Addition and Subtraction

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


Options are :

  • True
  • False

Answer :True

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

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


Options are :

  • Exponential
  • Addition
  • Multiplication
  • Parentheses

Answer :Parentheses

Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions