Robotics & Artificial Intelligence
Which of the following statements is true for functions in Python?
- Function is a reusable code segment of program.
- Function does not provide better modularity for your program.
- You cannot create your own functions in Python.
- All of these
Related Questions
Which of the following is not a part of function header?
- Keyword def
- Function_name
- Parameters
- Keyword return
The multiple values returned by the return statement are packed into the …………… data type.
- List
- Tuple
- Set
- None of these
Fill in the blanks:
- Function can accept inputs called ……………. .
- The ……………. arguments allow to specify a default value for a function parameter.
- The ……………. statement is used to return a value from a function.
- A function can have ……………. parameters, which have default values assigned to them.
- In a ……………., a large program is broken down into individual blocks of code that work together to complete a task.
- ……………. functions refer to those functions that are already defined in Python and user can use them directly without referring to any module or library.
- The ……………. keyword is used to define a user-defined function.
- The two parts of a function are ……………. and ……………. .
- ……………. are the names given to variables that are given in the parentheses in the function definition.
- Multiple values are returned by a function in the form of the ……………. data type.
- The function is called ……………. if it does not return any value or has an empty return statement.
- The functions that return some value using the return statement after execution are called ……………. functions.
Write a Python program to calculate the area of a square and a rectangle by defining a function.