Question-141: Which of the following is correct way of creating custom function
1.
def my_function_name()
function_body
2.Get all Questions and Answer from here
3.You need to have paid subscription to access all questions
4.Thanks for considering Python Certification Material
Answer: B
Exp:
Defining a function
- You have to use a def keyword to define a function.
- You must have thought for the proper and valid function name.
- And you should know, what should be the behavior for your function.
def my_function_name(): function_body |
- In function body you are going to write the behavior of the function.
- Function name should follow the same naming convention as variables.
Function name should end with () parenthesis.
You can access to full explanation to question and answer from this page.