Python Certification Exam Preparation Set 48

What is the value of the following expression?


Options are :

  • (6.0, 16.0) (Correct)
  • (6.00, 16.00)
  • (6, 16)
  • (6.00, 16.0)

Answer :(6.0, 16.0)

The result of the expression shown above is (6.0, 16.0). This is because the result is automatically rounded off to one decimal place.


Options are :

  • 123The time taken for the execution of the code (Correct)
  • 3The time taken for the execution of the code
  • 123UTC time
  • 3UTC time

Answer :123The time taken for the execution of the code

What is the output of the code shown below?

l=[-2, 4]

m=map(lambda x:x*2, l)

print(m)


Options are :

  • [-4, 16]
  • Address of m (Correct)
  • Error
  • -416

Answer :Address of m

Python Certification Exam Preparation Set 2

What is the output of the following?

def to_upper(k):

k.upper()

x = ['ab', 'cd']

print(list(map(to_upper, x)))


Options are :

  • ['AB', 'CD'].
  • ['ab', 'cd'].
  • none of the mentioned (Correct)
  • error

Answer :none of the mentioned

What is the output of the following?

x = [12, 34]

print(len(''.join(list(map(str, x)))))


Options are :

  • 4 (Correct)
  • 5
  • 6
  • Error

Answer :4

What is the output of the following?

x = abcd

print(list(map(list, x)))


Options are :

  • ['a', 'b', 'c', 'd'].
  • ['abcd'].
  • [['a'], ['b'], ['c'], ['d']].
  • none of the mentioned (Correct)

Answer :none of the mentioned

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

Is the output of the function abs() the same as that of the function math.fabs()?


Options are :

  • sometimes (Correct)
  • always
  • never
  • none of the mentioned

Answer :sometimes

What is returned by math.isfinite(float('nan'))?


Options are :

  • True
  • False (Correct)
  • None
  • error

Answer :False

What is the default base used when math.log(x) is found?


Options are :

  • e (Correct)
  • 10
  • 2
  • none of the mentioned

Answer :e

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

What does os.getlogin() return?


Options are :

  • name of the current user logged in (Correct)
  • name of the superuser
  • gets a form to login as a different user
  • all of the above

Answer :name of the current user logged in

What is the output of the line of code shown below?


pickle.HIGHEST_PROTOCOL


Options are :

  • 4 (Correct)
  • 5
  • 3
  • 6

Answer :4

Which of the following is true about top-down design process?


Options are :

  • The details of a program design are addressed before the overall design
  • Only the details of the program are addressed
  • The overall design of the program is addressed before the details (Correct)
  • Only the design of the program is addressed

Answer :The overall design of the program is addressed before the details

Python Certification Exam Preparation Set 1

What is the output of the function shown below (random module has already been imported)?

random.choice('sun')


Options are :

  • sun
  • u
  • either s, u or n (Correct)
  • error

Answer :either s, u or n

Which of the following will not be returned by random.choice("1 ,")?


Options are :

  • 1
  • (space)
  • ,
  • none of the mentioned (Correct)

Answer :none of the mentioned

What is the output of this code?


import sys

eval(sys.stdin.readline())

"India"


Options are :

  • India5
  • India
  • 'India\n'
  • 'India' (Correct)

Answer :'India'

Python Certification Exam Preparation Set 29

Which of the following functions does not accept any arguments?


Options are :

  • position (Correct)
  • fillcolor
  • goto
  • setheading()

Answer :position

What is the output of the following code?

import turtle

t=turtle.Pen()

t.right(90)

t.forward(100)

t.heading()


Options are :

  • 0.0
  • 90.0
  • 270.0 (Correct)
  • 360.0

Answer :270.0

The output of the code shown is similar to the alphabet _______________

import turtle

t=turtle.Pen()

t1=turtle.Pen()

t2=turtle.Pen()

t.forward(100)

t1.forward(100)

t2.forward(100)

t1.left(90)

t1.forward(75)

t2.right(90)

t2.forward(75)


Options are :

  • X
  • N
  • T (Correct)
  • M

Answer :T

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

What will be the output of the following Python code?


Options are :

  • ('[0] [1]',)
  • ('01',)
  • [0] [1] (Correct)
  • 01

Answer :[0] [1]

What will be the output of the following Python code?


Options are :

  • ('[0] [1]',) (Correct)
  • ('01')
  • [0] [1]
  • 01

Answer :('[0] [1]',)

What will be the output of the following Python code?


Options are :

  • 3456
  • (3456)
  • ('3456')
  • ('3456',) (Correct)

Answer :('3456',)

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

What will be the output of the following Python code?


Options are :

  • 3456 (Correct)
  • (3456)
  • ('3456')
  • ('3456',)

Answer :3456

What will be the output of the following Python code?


Options are :

  • [34, 56]
  • ['34', '56']
  • 34 56
  • error (Correct)

Answer :error

What will be the output of the following Python code?


Options are :

  • ['a', 'b', 'c', 'd']
  • ['abcd']
  • [['a'], ['b'], ['c'], ['d']] (Correct)
  • none of the mentioned

Answer :[['a'], ['b'], ['c'], ['d']]

Python Certification Exam Preparation Set 23

What will be the output of the following Python code?


Options are :

  • ['a', 'b', 'c', 'd']
  • ['abcd']
  • [['a'], ['b'], ['c'], ['d']]
  • none of the mentioned (Correct)

Answer :none of the mentioned

What will be the output of the following Python code?


Options are :

  • [1, 2, 3, 4]
  • [1234]
  • [[1], [2], [3], [4]]
  • none of the mentioned (Correct)

Answer :none of the mentioned

What will be the output of the following Python code?


Options are :

  • [1, 2, 3, 4]
  • [1234]
  • [[1], [2], [3], [4]]
  • none of the mentioned (Correct)

Answer :none of the mentioned

Python Certification Exam Preparation Set 42

What will be the output of the following Python code?


Options are :

  • ['a', 'b', 'c', 'd']
  • ['abcd']
  • [['a'], ['b'], ['c'], ['d']]
  • none of the mentioned (Correct)

Answer :none of the mentioned

Is Python code compiled or interpreted?


Options are :

  • Python code is only compiled
  • Python code is both compiled and interpreted (Correct)
  • Python code is only interpreted
  • Python code is neither compiled nor interpreted

Answer :Python code is both compiled and interpreted

Which of these is the definition for packages in Python?


Options are :

  • A folder of python modules (Correct)
  • A set of programs making use of Python modules
  • A set of main modules
  • A number of files containing Python definitions and statements

Answer :A folder of python modules

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

Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions