Python Certification Exam Preparation Set 25

Evaluate the expression given below if A = 16 and B = 15.


Options are :

  • 0.0
  • 1.0
  • 0 (Correct)
  • 1

Answer :0

Python Certification Exam Preparation Set 27

What will be the output of the following Python code?


Options are :

  • [4, 5, 6, 8, 10, 12, 12, 15, 18] (Correct)
  • [4, 8, 12, 5, 10, 15, 6, 12, 18]
  • [18, 12, 6, 15, 10, 5, 12, 8, 4]
  • [4, 10, 18]

Answer :[4, 5, 6, 8, 10, 12, 12, 15, 18]

Suppose list1 is [4, 2, 2, 4, 5, 2, 1, 0], Which of the following is correct syntax for slicing operation?


Options are :

  • print(list1[0])
  • print(list1[:-2])
  • all of the mentioned (Correct)
  • print(list1[:2])

Answer :all of the mentioned

What is the output of print(k) in the following Python code snippet?


Options are :

  • all characters of my_string that aren't vowels
  • list of Falses
  • list of Trues
  • a list of Nones (Correct)

Answer :a list of Nones

Python Certification Exam Preparation Set 63

Suppose list1 is [2, 33, 222, 14, 25], What is list1[-1]?   


Options are :

  • None
  • 2
  • 25 (Correct)
  • Error

Answer :25

To shuffle the list(say list1) what function do we use? 


Options are :

  • random.shuffleList(list1)
  • list1.shuffle()
  • shuffle(list1)
  • random.shuffle(list1) (Correct)

Answer :random.shuffle(list1)

What is the value of the following expression?


Options are :

  • (1.0, 1.0)
  • (1.0, 4.0) (Correct)
  • (4.0, 4.0)
  • (4.0. 1.0)

Answer :(1.0, 4.0)

Python Certification Exam Preparation Set 48

Suppose list1 is [2, 33, 222, 14, 25], What is list1[:-1]?   


Options are :

  • [2, 33, 222, 14] (Correct)
  • Error
  • [25, 14, 222, 33, 2]
  • 25

Answer :[2, 33, 222, 14]

Which of the following is the correct expansion of list_1 = [expr(i) for i in list_0 if func(i)]?


Options are :

  • list_1 = [] for i in list_0: if func(i): list_1.append(i)
  • list_1 = [] for i in list_0: if func(i): list_1.append(expr(i)) (Correct)
  • none of the mentioned
  • for i in list_0: if func(i): list_1.append(expr(i))

Answer :list_1 = [] for i in list_0: if func(i): list_1.append(expr(i))

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


Options are :

  • prints all the vowels in my_string
  • prints only on executing print(k)
  • prints all characters of my_string that aren't vowels (Correct)
  • prints all the consonants in my_string

Answer :prints all characters of my_string that aren't vowels

Python Certification Exam Preparation Set 14

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


Options are :

  • ['ad', 'ae', 'af', 'bd', 'be', 'bf', 'cd', 'ce', 'cf']
  • ['da', 'ea', 'fa', 'db', 'eb', 'fb', 'dc', 'ec', 'fc']
  • [['ad', 'bd', 'cd'], ['ae', 'be', 'ce'], ['af', 'bf', 'cf']] (Correct)
  • [['da', 'db', 'dc'], ['ea', 'eb', 'ec'], ['fa', 'fb', 'fc']]

Answer :[['ad', 'bd', 'cd'], ['ae', 'be', 'ce'], ['af', 'bf', 'cf']]

The value of the expressions 4/(3*(2-1)) and 4/3*(2-1) is the same.


Options are :

  • True (Correct)
  • False

Answer :True

Suppose list1 is [3, 5, 25, 1, 3], what is min(list1)?   


Options are :

  • 1 (Correct)
  • 3
  • 5
  • 25

Answer :1

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

Who created Python?


Options are :

  • Guido ban Rossum
  • Guido van Rossum (Correct)
  • Guido the Russian
  • Guodo van Rossum

Answer :Guido van Rossum

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

Which of the following is not a python version?


Options are :

  • CPython
  • Cython
  • Jython
  • PyPY
  • Zython (Correct)

Answer :Zython

Name a tool which helps to launch your code step by step and allow you to inspect it at each moment of execution:


Options are :

  • Editor
  • Compiler
  • Debugger (Correct)
  • Console

Answer :Debugger

Select the correct code from the given options to match the below expected output:


Options are :

  • print("Python","Essentials", sep="-", end=">") print("Must","-Read")
  • print("Python","Essentials", sep="-", end="->") print("Must","Read", sep="-") (Correct)
  • print("Python","Essentials", sep="-", end=">") print("Must","Read")
  • print("Python","Essentials", sep="-", end=">") print("Must","-","Read")

Answer :print("Python","Essentials", sep="-", end="->") print("Must","Read", sep="-")

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

An integer number preceded by an 0x (Zero-x) will be treated as:


Options are :

  • Octal
  • Hexadecimal (Correct)
  • Binary
  • Decimal

Answer :Hexadecimal

An integer number preceded by an 0o (Zero-o) will be treated as:


Options are :

  • Octal (Correct)
  • Hexadecimal
  • Binary
  • Decimal

Answer :Octal

The binary number has the following base:


Options are :

  • 2 (Correct)
  • 10
  • 8
  • 16

Answer :2

Python Certification Exam Preparation Set 13

Hexadecimal has the following base:


Options are :

  • 2
  • 8
  • 10
  • 16 (Correct)

Answer :16

Octal has the following base:


Options are :

  • 2
  • 8 (Correct)
  • 10
  • 16

Answer :8

Decimal has the following base:


Options are :

  • 2
  • 8
  • 10 (Correct)
  • 16

Answer :10

Python Certification Exam Preparation Set 47

Which of the following code will give an error?


Options are :

  • print('I like "Python" ')
  • print("I like \"Python\" ")
  • print("I like 'Python' ")
  • print("I like "Python" ") (Correct)

Answer :print("I like "Python" ")

What will be the output of the following code snippet?

print(True > False)

print(True < False)


Options are :

  • 1 0
  • 0 1
  • True False (Correct)
  • False True

Answer :True False

Lists can be nested.


Options are :

  • True (Correct)
  • False

Answer :True

Python Certification Exam Preparation Set 67

Which of the following is the correct way to define a function in Python?


Options are :

  • def fun(): (Correct)
  • del fun():
  • desc fun():
  • defi fun():

Answer :def fun():

The len() function is used:


Options are :

  • To increase the length of the List.
  • To check the length of the List. (Correct)
  • To get log value of the number.
  • None of these option.

Answer :To check the length of the List.

Dictionary in Python is a mutable data structure.


Options are :

  • True (Correct)
  • False

Answer :True

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

Which of the following is incorrect for a dictionary in Python?


Options are :

  • each key must be unique
  • the key should be an immutable object
  • the len() function returns the numbers of key-value elements in the dictionary
  • the len() function returns the sum of key-value elements in the dictionary (Correct)

Answer :the len() function returns the sum of key-value elements in the dictionary

Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions