The correct answer is option D (def). def keyword is used to define the function and is used in the start of the function. This def keyword is used to create a user-defined function. Here is the syntax of def keyword:
def FunctionName:
function definition statements
Example to create a function to find the sum of two numbers:
def sumNumbers (x, y):
return (x+y)
result = sumNumbers (10, 20)
print(“sum of the numbers is = “, result)
output:
sum of the numbers is = 30
You can check out this Python Tutorial to learn defining functions.
You can watch this video on Python tutorial in Hindi by Intellipaat to learn defining functions.