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

What will be the output of the following Python function?


Options are :

  • 2
  • False
  • -3
  • -4

Answer :False

What will be the output of the following Python functions?


Options are :

  • a Error
  • 'a' a
  • Error a
  • Error Error

Answer : Error a

Python Certification Exam Preparation Set 54

What will be the output of the following Python function?


Options are :

  • Error
  • 1
  • 2j
  • 1+2j

Answer :1+2j

What is the output of the function complex()?


Options are :

  • 0j
  • 0+0j
  • 0
  • Error

Answer :0j

The function divmod(a,b), where both 'a' and 'b' are integers is evaluated as:


Options are :

  • (a%b, a//b)
  • (a//b, a%b)
  • (a//b, a*b)
  • (a/b, a%b)

Answer :(a//b, a%b)

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

What will be the output of the following Python function?


Options are :

  • (2.00, 0.50) (2.00, 0.00)
  • (2, 0.5) (2, 0)
  • (2.0, 0.5) (2.0, 0.0)
  • (2, 0.5) (2)

Answer :(2.0, 0.5) (2.0, 0.0)

The function complex('2-3j') is valid but the function complex('2 – 3j') is invalid.


Options are :

  • True
  • False

Answer :True

 What will be the output of the following Python function?


Options are :

  • Error
  • [(1, 2), (2, 3)]
  • [(0, 2), (1, 3)]
  • [(2, 3)]

Answer :[(0, 2), (1, 3)]

Python Certification Exam Preparation Set 21

What will be the output of the following Python functions?


Options are :

  • Error
  • 1
  • 9
  • 6

Answer :1

What will be the output of the following Python functions?


Options are :

  • 3.00 300
  • 0.001 2000.0
  • 0.001 200
  • Error 2003

Answer :0.001 2000.0

Which of the following functions does not necessarily accept only iterables as arguments?


Options are :

  • enumerate()
  • all()
  • chr()
  • max()

Answer :chr()

Python Certification Exam Preparation Set 56

Which of the following functions accepts only integers as arguments?


Options are :

  • ord()
  • min()
  • chr()
  • any()

Answer :chr()

Suppose there is a list such that: l=[2,3,4]. If we want to print this list in reverse order, which of the following methods should be used?


Options are :

  • reverse(l)
  • list(reverse[(l)])
  • reversed(l)
  • list(reversed(l))

Answer :list(reversed(l))

What will be the output of the following Python function?

(Note that the number of blank spaces before the number is 5)


Options are :

  • -12345.0 (5 blank spaces before the number)
  • -12345.0
  • Error
  • -12345.000000000…. (infinite decimal places)

Answer :-12345.0

Python Certification Exam Preparation Set 62

What will be the output of the following Python function?


Options are :

  • A 65
  • Error 65
  • A Error
  • Error Error

Answer :Error 65

What will be the output of the following Python function?


Options are :

  • –inf inf
  • –infinity inf
  • Error Error
  • Error Junk value

Answer :–inf inf

Which of the following functions will not result in an error when no arguments are passed to it?


Options are :

  • min()
  • divmod()
  • all()
  • float()

Answer :float()

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

What will be the output of the following Python function?


Options are :

  • f
  • 0xF
  • 0Xf
  • 0xf

Answer :0xf

Which of the following functions does not throw an error?


Options are :

  • ord()
  • ord(' ')
  • ord(")
  • ord("")

Answer :ord(' ')

What will be the output of the following Python function?


Options are :

  • 4
  • 3
  • Error
  • 6

Answer :4

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

What will be the output of the following Python function?


Options are :

  • Error 07
  • 0o7 Error
  • 0o7 Error
  • 07 0o7

Answer :0o7 Error

Which of the following is the use of function in python?


Options are :

  • Functions are reusable pieces of programs
  • Functions don't provide better modularity for your application
  • you can't also create your own functions
  • All of the mentioned

Answer :Functions are reusable pieces of programs

Which keyword is used for function?


Options are :

  • Fun
  • Define
  • Def
  • Function

Answer :Def

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 :

  • Hello World! Hello World!
  • 'Hello World!' 'Hello World!'
  • Hello Hello
  • None of the mentioned

Answer :Hello World! Hello World!

What will be the output of the following Python code?


Options are :

  • 3
  • 4
  • 4 is a maximum
  • None of the mentioned

Answer :4 is a maximum

What will be the output of the following Python code?


Options are :

  • x is now 50
  • x is now 2
  • x is now 100
  • None of the mentioned

Answer :x is now 50

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

What will be the output of the following Python code?


Options are :

  • x is 50 Changed global x to 2 Value of x is 50
  • x is 50 Changed global x to 2 Value of x is 2
  • x is 50 Changed global x to 50 Value of x is 50
  • None of the mentioned

Answer :x is 50 Changed global x to 2 Value of x is 2

What will be the output of the following Python code?


Options are :

  • Hello WorldWorldWorldWorldWorld
  • Hello World 5
  • Hello World,World,World,World,World
  • Hello HelloHelloHelloHelloHello

Answer :Hello WorldWorldWorldWorldWorld

What will be the output of the following Python code?


Options are :

  • a is 7 and b is 3 and c is 10 a is 25 and b is 5 and c is 24 a is 5 and b is 100 and c is 50
  • a is 3 and b is 7 and c is 10 a is 5 and b is 25 and c is 24 a is 50 and b is 100 and c is 5
  • a is 3 and b is 7 and c is 10 a is 25 and b is 5 and c is 24 a is 100 and b is 5 and c is 50
  • None of the mentioned

Answer :a is 3 and b is 7 and c is 10 a is 25 and b is 5 and c is 24 a is 100 and b is 5 and c is 50

Python Certification Exam Preparation Set 58

What will be the output of the following Python code?


Options are :

  • 2
  • 3
  • The numbers are equal
  • None of the mentioned

Answer :3

Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions