Question 1 of 25
Hints left: 3
Q1
What does the return statement in a function do?
Q2
What is the output of the following code: my_string = "Hello, World!" print(my_string.split())
Q3
Which of the following is NOT a valid function name in Python?
Q4
Which built-in function is used to capitalize the first letter of a string?
Q5
The function complex('2-3j') is valid but the function complex('2 - 3j') is invalid.
Q6
What will be the output of the following Python function? divmod(10.5,5) divmod(2.4,1.2)
Q7
What does the lambda keyword do when used in a function?
Q8
What is the purpose of the global keyword do when used in a function?
Q9
What is the purpose of the built-in function abs()?
Q10
What will be the output of the following Python function? min(max(False,-3,-4), 2,7)
Q11
Which of the following functions will not result in an error when no arguments are passed to it?
Q12
Which built-in function is used to convert a value to a floating-point number?
Q13
How can you make a parameter optional in a Python function?
Q14
What does the built-in function sorted() do in Python?
Q15
Which of the following functions accepts only integers as arguments?
Q16
What will be the output of the following Python function? sum(2,4,6) sum([1,2,3])
Q17
What will be the output of the following code: my_string = "Hello, World!" print(my_string.replace("Hello", "Hi"))
Q18
The function pow(x,y,z) is evaluated as:
Q19
What is the purpose of the pass statement in a function?
Q20
What will be the output of the following Python function? import math abs(math.sqrt(25))
Q21
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?
Q22
How is a function defined in Python?
Q23
What will be the output of the following code: my_list = [1, 2, 3, 4] print(len(my_list))
Q24
How can you pass a variable number of keyword arguments to a function in Python?
Q25
What is the purpose of the def keyword in Python?