Font size
WorksheetsPython Built-in Functions
Total questions: 15
Worksheet time: 15mins
1. Which of the following functions is a built-in function in python?
a) seed()
b) sqrt()
c) factorial()
d) print()
2. Which keyword is used for function?
a) define
b) fun
c) def
d) function
3. What will be the output of the following Python expression?
round(4.576)
a) 4.5
b) 5
c) 4
d) 4.6
4. 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
5. What will be the output of the following Python function?
all([2,4,0,6])
a) Error
b) True
c) False
d) 0
6. 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
7. What will be the output of the following Python function?
any([2>8, 4>2, 1>2])
a) Error
b) True
c) False
d) 4 > 2
8. Which of the following items are present in the function header?
a) function name
b) Parameter list
c) return value
d) Both A and B
9. What is called when a function is defined inside a class?
a) class
b) function
c) method
d) module
10. If return statement is not used inside the function, the function will return:
a) None
b) 0
c) Null
d) Arbitary value
11. What will be the output of the following Python function?
import math
abs(math.sqrt(25))
a) Error
b) -5
c) 5
d) 5.0
12. What is a variable defined outside a function referred to as?
a) local variable
b) global variable
c) static variable
d) automatic variable
13. Which of the following operators is the correct option for power(ab)?
a) a ^ b
b) a**b
c) a^^ b
d) a ^ * b
14. Which one of the following has the highest precedence in the expression?
a) Division
b) Subtraction
c) Power
d) Paranthesis
15. What error will occur when you execute the following code?
MANGO = APPLE
a) NameError
b) Syntax Error
c) Type Error
d) Value Error
