Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (55.6k points)

A. help

B. rad

C. break

D. def

1 Answer

0 votes
by (119k points)

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.

Related questions

0 votes
1 answer
asked Mar 23, 2021 in Python by Rekha (2.2k points)
0 votes
3 answers
0 votes
1 answer
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...