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