Ask Question
19 July, 07:10

What is the purpose of the "def" keyword in Python?

a) It is slang that means "the following code is really cool"

b) It indicates the start of a function

c) It indicates that the following indented section of code is to be stored for later

d) b and c are both true

e) None of the above

+5
Answers (1)
  1. 19 July, 08:06
    0
    d) b and c are both true.

    Explanation:

    The purpose of def keyword in python is to indicate start the function and it also indicates that the piece of code following the def keyword is to stored so that it can later be used in the program.

    For ex:

    def check (n):

    if n==10:

    return True

    return False

    n=int (input ("Enter an integer/n"))

    if check (n):

    print ("n is 10")

    else:

    print ("n is not 10")

    In the above written code the function check is defined by using the keyword def. It also tells the interpreter to store the code because we will need it in future.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “What is the purpose of the "def" keyword in Python? a) It is slang that means "the following code is really cool" b) It indicates the start ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers