Computational Thinking and Programming – 2

Functions Quiz for Class 12:

Topics covered:

Types of function (built-in functions, functions defined in module, user defined functions), creating user defined function, arguments and parameters, default parameters, positional parameters, function returning value(s), flow of execution, scope of a variable (global scope, local scope)

1. What are the three types of functions?

 
 
 
 

2. Which of the following is an example of a built-in function?

 
 
 
 

3. How are functions defined in a module accessed?

 
 
 
 

4. What is the purpose of user-defined functions?

 
 
 
 

5. What is an argument in the context of functions?

 
 
 
 

6. What is a default parameter in a function?

 
 
 
 

7. Which of the following is an example of a positional parameter?

 
 
 
 

8. What is the purpose of a function returning a value?

 
 
 
 

9. What is the flow of execution in a program?

 
 
 
 

10. What is the scope of a variable defined outside of any function?

 
 
 
 

11. In Python, what keyword is used to declare a global variable within a function?

 
 
 
 

12. Which type of variable is accessible only within the function where it is defined?

 
 
 
 

13. How can you modify the value of a global variable within a function?

 
 
 
 

14. What is the purpose of the ‘return’ statement in a function?

 
 
 
 

15. Which of the following is an example of a local variable?

 
 
 
 

Copywrite © 2020-2024, CBSE Python,
All Rights Reserved