Page 102 - ThinkGPT_V2.1_C8_Flipbook
P. 102
REFRESH
A function is a block of organised and reusable code used to perform a single or related action.
Python functions can be categorised into built-in functions and user-defined functions.
A function can be called anytime from other functions or from the command prompt after the definition.
TeCh Ready
A. Tick ( ) the correct option.
1. Which of the following receives data in the form of arguments and uses it to run a specified set of
statements and produces the final output?
(i) Function (ii) Operator
(iii) Parameter (iv) Sequence
2. Which of the following are the features of functions?
(i) A program is divided into small modules and each module performs some specific task.
Each module can be called as per the requirement.
(ii) It also reduces the length of the program.
(iii) It makes debugging easy and makes the code efficient, both in terms of time and memory.
(iv) All of these
3. Which of the following is/are the component(s) of Python function?
(i) Name of the function (ii) Arguments
(iii) Return Value (iv) All of these
4. Which of the following is an example of built-in functions?
(i) print( ) (ii) input( )
(iii) Both (i) and (ii) (iv) None of these
5. Which of the following contains Python statement and makes function to perform the
required task?
(i) Naming a Function (ii) Parameters
(iii) Body of the function (iv) None of these
B. Fill in the blanks using the words given below.
def user-defined arguments command return
1. A function may or may not a value.
100 Premium Edition-VIII

