Working with Functions in Python Class 12 MCQ

Teachers and Examiners (CBSESkillEduction) collaborated to create the Working with Functions in Python Class 12 MCQ. All the important Information are taken from the NCERT Textbook Computer Science (083) class 12.

Working with Functions in Python Class 12 MCQ

1. Which of the following is the use of function in python?
a) Functions are reusable pieces of programs 
b) Functions don’t provide better modularity for your application
c) you can’t also create your own functions
d) All of the mentioned

Show Answer ⟶
a) Functions are reusable pieces of programs

2. Which keyword is used for function?
a) Fun
b) Define
c) Def 
d) Function

Show Answer ⟶
c) Def

3. What will be the output of the following Python code?
def sayHello():
print(‘Hello World!’)
sayHello()
sayHello()

a. Hello World! 
Hello World!
b. Hello World!
c. Hello World!
Hello World!
Hello World!
d. None of the above

Show Answer ⟶
a. Hello World!
Hello World!

4. In programming, the use of ___________ is one of the means to achieve modularity and reusability.
a. String
b. If-Statement
c. Lists
d. Function 

Show Answer ⟶
d. Function

Working with Functions in Python Class 12 MCQ

5. __________ can be defined as a named group of instructions that accomplish a specific task when it is invoked.
a. String
b. If-Statement
c. Lists
d. Function 

Show Answer ⟶
d. Function

6. What are the advantages of function?
a. Increases readability
b. Reduces code
c. Increases reusability
d. All of the above 

Show Answer ⟶
d. All of the above

7. __________ length as the same code is not required to be written at multiple places in a program. This also makes debugging easier.
a. Increases readability
b. Reduces code 
c. Increases reusability
d. All of the above

Show Answer ⟶
b. Reduces code

8. We can define our own functions while writing the program. Such functions are called __________.
a. User defined function 
b. Predefined function
c. Both a) and b)
d. None of the above

Show Answer ⟶
a. User defined function

9. A function defined to achieve some task as per the programmer’s requirement is called a ____________.
a. User defined function
b. Predefined function 
c. Both a) and b)
d. None of the above

Show Answer ⟶
b. Predefined function

Working with Functions in Python Class 12 MCQ

10. The items enclosed in “[ ]” are called ___________ and they are optional.
a. Function
b. Parameters 
c. Values
d. None of the above

Show Answer ⟶
b. Parameters

11. Function header always ends with a _________.
a. Colon (:) 
b. Semi-Colon (;)
c. Both a) and b)
d. None of the above

Show Answer ⟶
a. Colon (:)

12. Function name should be __________.
a. Unique 
b. Repeated
c. Only keyword name can be added
d. None of the above

Show Answer ⟶
a. Unique

13. The statements outside the function indentation are not considered as _____________.
a. Not a part of the function
b. Part of the function 
c. Some time it is part of function
d. None of the above

Show Answer ⟶
b. Part of the function

14. ____________ is a value passed to the function during the function call which is received in the corresponding parameter defined in the function header.
a. Parameters
b. Arguments 
c. Values
d. None of the above

Show Answer ⟶
b. Arguments

Working with Functions in Python Class 12 MCQ

15. We can use the _________ function to find the identity of the object that the argument and parameter are referring to.
a. identity()
b. id() 
c. ids()
d. None of the above

Show Answer ⟶
b. id()

16. A __________ is a value that is pre decided and assigned to the parameter when the function call does not have its corresponding argument.
a. Default Value 
b. Value
c. Null Value
d. None of the above

Show Answer ⟶
a. Default Value

17. In python ___________ should be in the same order as that of the arguments.
a. Values
b. Parameters 
c. Function name
d. None of the above

Show Answer ⟶
b. Parameters

18. In python,________ statement returns the values from the function.
a. Reverse
b. Return 
c. Back
d. None of the above

Show Answer ⟶
b. Return

19. In python, function can be defined as _________ ways.
a. No argument and no return value
b. Argument and with return value
c. Arguments and no return value
d. All of the above 

Show Answer ⟶
d. All of the above

Working with Functions in Python Class 12 MCQ

20. The Python interpreter starts executing the instructions in a program from the _________.
a. First Statement 
b. Second Statement
c. Third Statement
d. None of the above

Show Answer ⟶
a. First Statement

21. The translator executes the code one by one is known as __________.
a. Translator
b. Compiler
c. Interpreter 
d. None of the above

Show Answer ⟶
c. Interpreter

22. A variable defined inside a function cannot be accessed ________ it.
a. Outside 
b. Inside
c. Both a) and b)
d. None of the above

Show Answer ⟶
a. Outside

23. A variable that has global scope is known as a ___________.
a. Local variable
b. Global variable 
c. Define variable
d. None of the above

Show Answer ⟶
b. Global variable

24. A variable that has a local scope is known as a ________.
a. Local variable 
b. Global variable
c. Define variable
d. None of the above

Show Answer ⟶
a. Local variable

Working with Functions in Python Class 12 MCQ

25. In Python, a variable that is defined outside any function or any block is known as a ________.
a. Local variable
b. Global variable 
c. Define variable
d. None of the above

Show Answer ⟶
b. Global variable

26. Any change made to the global variable will impact ___________ in the program where that variable can be accessed.
a. Only one function
b. All the functions 
c. Only two functions
d. None of the above

Show Answer ⟶
b. All the functions

27. A variable that is defined inside any function or a block is known as a __________.
a. Local variable 
b. Global variable
c. Define variable
d. None of the above

Show Answer ⟶
a. Local variable

28. Any modification to a global variable is permanent and affects _________ where it is used.
a. Only one function
b. All the functions 
c. Only two functions
d. None of the above

Show Answer ⟶
b. All the functions

29. If a variable with the same name as the global variable is defined inside a function, then it is considered _________ to that function.
a. Local variable 
b. Global variable
c. Define variable
d. None of the above

Show Answer ⟶
a. Local variable

Working with Functions in Python Class 12 MCQ

30. For a complex problem, it may not be feasible to manage the code in one single file. Then, the program is divided into different parts under different levels, called ________.
a. Modules 
b. Code
c. Variable
d. None of the above

Show Answer ⟶
a. Modules

31. What is the extension of python?
a. .pyy
b. .py 
c. .pyh
d. None of the above

Show Answer ⟶
b. .py

32. What is the syntax of import statements in python?
a. import modulename1 [,modulename2, …] 
b. imp modulename1 [,modulename2, …]
c. Both a) and b)
d. None of the above

Show Answer ⟶
a. import modulename1 [,modulename2, …]

33. To call a function of a module, the function name should be preceded with the name of the module with a _______.
a. comma(,)
b. dot(.) 
c. Semicolon(;)
d. None of the above

Show Answer ⟶
b. dot(.)

34. _________ functions that are used for generating random numbers.
a. random.random()
b. random.randint()
c. random.randrange()
d. All of the above 

Show Answer ⟶
d. All of the above

Working with Functions in Python Class 12 MCQ

35. In programming, functions are used to achieve modularity and reusability.
a. Modularity
b. Reusability
c. Both a) and b) 
d. None of the above

Show Answer ⟶
c. Both a) and b)

36. Function can be defined as a named group of instructions that are executed when the function is invoked or called by its name.
a. Its name 
b. Other names
c. No name
d. All of the above

Show Answer ⟶
a. Its name

37. Programmers can write their own functions known as _________.
a. Pre defined function
b. User defined function
c. Both a) and b) 
d. None of the above

Show Answer ⟶
c. Both a) and b)

38. The Python interpreter has a number of functions built into it. These are the functions that are frequently used in a Python program. Such functions are known as _________.
a. built in program
b. built in function 
c. built in arguments
d. None of the above

Show Answer ⟶
b. built in function

39. An __________ is a value passed to the function during a function call which is received in a parameter defined in the function header.
a. Argument 
b. function
c. Both a) and b)
d. None of the above

Show Answer ⟶
a. Argument

Working with Functions in Python Class 12 MCQ

40. Python allows assigning a ________ to the parameter.
a. Predefined value
b. default value 
c. No value
d. None of the above

Show Answer ⟶
b. default value

41. A function returns value(s) to the calling function using ________.
a. Reverse statement
b. Return statement 
c. Both a) and b)
d. None of the above

Show Answer ⟶
b. Return statement

42. Multiple values in Python are returned through a _______.
a. String
b. Tuple 
c. Both a) and b)
d. None of the above

Show Answer ⟶
b. Tuple

43. The part of the program where a variable is accessible is defined as the _________.
a. Scope of the variable 
b. Scope of the function
c. Scope of the code
d. None of the above

Show Answer ⟶
a. Scope of the variable

44. A variable that is defined outside any particular function or block is known as a ___________. It can be accessed anywhere in the program.
a. Local variable
b. Global variable 
c. Define variable
d. None of the above

Show Answer ⟶
b. Global variable

Working with Functions in Python Class 12 MCQ

45. A variable that is defined inside any function or block is known as a __________. It can be accessed only in the function or block where it is defined. It exists only till the function executes or remains active.
a. Local variable 
b. Global variable
c. Define variable
d. None of the above

Show Answer ⟶
a. Local variable

46. A module can be imported in a program using ________ statement.
a. Insert
b. Invoke
c. Import 
d. All of the above

Show Answer ⟶
c. Import

Computer Science Class 12 Notes

  1. Python Revision tour – 1 Class 12 Notes
  2. Python Revision tour – 2 Class 12 Notes Notes
  3. Working with Functions Class 12 Notes
  4. Using Python Libraries Class 12 Notes
  5. File Handling Class 12 Notes
  6. Recursion Class 12 Notes
  7. Idea of Algorithmic Efficiency Class 12 Notes
  8. Data Visualization using Pyplot Class 12 Notes
  9. Data Structure Class 12 Notes
  10. Computer Network Class 12 Notes
  11. More on MySQL Class 12 Notes

MCQ for Class 12 Computer Science Python

  1. Python Revision tour – 1 Class 12 MCQs
  2. Python Revision tour – 2 Class 12 MCQs
  3. Working with Functions Class 12 MCQs
  4. Using Python Libraries Class 12 MCQs
  5. File Handling Class 12 MCQs
  6. Recursion Class 12 MCQs
  7. Data Visualization using Pyplot Class 12 MCQs
  8. Data Structure Class 12 MCQs
  9. Computer Network Class 12 MCQs
  10. More on MySQL Class 12 MCQs

Computer Science Class 12 Questions and Answers

  1. Python Revision tour – 1 Class 12 Questions and Answers
  2. Working with Functions Class 12 Questions and Answers
  3. Using Python Libraries Class 12 Questions and Answers
  4. File Handling Class 12 Questions and Answers
  5. Recursion Class 12 Questions and Answers
  6. Idea of Algorithmic Efficiency Class 12 Questions and Answers
  7. Data Structure Class 12 Questions and Answers
  8. More on MySQL Class 12 Questions and Answers
  9. Computer Network Class 12 Questions and Answers
  10. More on MySQL Class 12 Questions and Answers 
error: Content is protected !!