Python Builtins: Python Functions Multiple Choice Q&A

Python Builtins. MCQs on Built in Functions in Python Language.

 

Python Builtins

 

 

What will be the output of the following Python function ??

min(max(False,-3,-4), 2,7)

a) 2
b) False
c) -3
d) -4

 

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 ??

a) reverse(l)
b) list(reverse[(l)])
c) reversed(l)
d) list(reversed(l))

 

What is the output of the function complex() ??

a) 0j
b) 0+0j
c) 0
d) Error

 

What will be the output of the following Python ??

all(3,0,4.2)

a) True
b) False
c) Error
d) 0

 

Python Builtins

 

What will be the output of the following ??

sum(2,4,6)
sum([1,2,3])

a) Error, 6
b) 12, Error
c) 12, 6
d) Error, Error

 

What will be the output ??

import math
abs(math.sqrt(25))

a) Error
b) -5
c) 5
d) 5.0

 

What will be the output of the following code ??

any([2>8, 4>2, 1>2])

a) Error
b) True
c) False
d) 4>2

 

Which of the following functions accepts only integers as arguments ??

a) ord()
b) min()
c) chr()
d) any()

 

Python Builtins

 

What will be the output of the following ??

complex(1+2j)

a) Error
b) 1
c) 2j
d) 1+2j

 

What will be the output of the following Python expression ??

round(4.5676,2)?

a) 4.5
b) 4.6
c) 4.57
d) 4.56

 

What will be the output of the following code ??

all([2,4,0,6])

a) Error
b) True
c) False
d) 0

 

The function pow(x,y,z) is evaluated as ??

a) (x**y)**z
b) (x**y) / z
c) (x**y) % z
d) (x**y)*z

 

Python Builtins

 

Which of the following functions is a built-in function in python ??

a) seed()
b) sqrt()
c) factorial()
d) print()

 

What will be the output of the following Python functions ??

chr(‘97’)
chr(97)

a) a
Error

b) ‘a’
a

c) Error
a

d) Error
Error

 

What will be the output of the following Python expression ??

round(4.576)

a) 4.5
b) 5
c) 4
d) 4.6

 

Read More

Leave a Comment

Your email address will not be published. Required fields are marked *

error: Content is protected !!