What is tail recursion?
A. A recursive function that has two base cases
B. A function where the recursive functions leads to an infinite loop
C. A recursive function where the function doesn't return anything and just prints the values
D. A function where the recursive call is the last thing executed by the function
Answer: Option D
What does the return statement in a function do?
A. It specifies the value to be returned from the function
B. It ends the execution of the function
C. It prints the result on the screen
D. It defines the function's name
How can you make a parameter optional in a Python function?
A. By using the optional keyword
B. By providing a default value to the parameter
C. By making the parameter lowercase
D. By using a special keyword opt
Which of the following is NOT a valid function name in Python?
A. my_function
B. 2nd_function
C. _function
D. function123
What is the purpose of the def keyword in Python?
A. It is used to define a function
B. It is used to declare a variable
C. It is used to import a module
D. It is used to create a loop

Join The Discussion