Class 11 Computer Science Chapter 5 Functions In Python Quiz 14 (25 MCQs)

Quiz Instructions

Select an option to see the correct answer instantly.

1. What will be the output of the following code? "'pythondef square(x):return x * xresult = square(3)print(result) "'
2. Which of the following is TRUE about procedures in Python?
3. What will be the output of the following code? "'pythondef multiply(x, y=2):return x * yresult = multiply(5)print(result) "'
4. Which of the following statements about return statements is FALSE?
5. Which keyword is used to return a value from a function in Python?
6. What is the output of the following code? def add():x, y = 4, 7; print('Sum:', x + y); add()
7. How can you specify a default value for a function parameter in Python?
8. What is a function in programming?
9. Leo wants to create a function that will roll a dice. Which is the correct function definition header?
10. Which of the following statements is FALSE about local and global variables?
11. Which of the following is an example of a keyword argument?
12. A function is said to be ..... if it calls itself
13. Which of the following is a valid lambda function in Python?
14. What is the default starting value of the range() function?
15. What is a parameter in a function?
16. Which of the following is a valid way to return multiple values from a function in Python?
17. The values received in the function definition/header statement are called .....
18. Which of the following keyword is used to define the function testpython():
19. There are predefined functions that are available in a module. For using them we need to import the module.
20. What is the output of the following code? "'pythondef f(x):return x**2print(f(5)) "'
21. Study the following program and select the possible output:import randomX = random.random()Y = random.randint(0, 4)print(int(X), ":", Y + int(X))
22. If a function returns a value, it should generally be called from
23. What are the two main types of functions?
24. Value returning functions should be generally called from inside of an expression.
25. What is the output of the function call print(greet('Alice'))?