Computer Science, asked by mine7799, 7 months ago

In python how do you indicate the end of the block of code that makes up the function

Answers

Answered by BrainlyYoda
8

Question:

In Python, how do you indicate the end of the block of code that makes up the function?

(A) You put a # character at the end of the last line of the function

(B) You de-indent a line of code to the same indent level as the def keyword

(C) You add a line that has at least 10 dashes

(D) You put the colon character (:) in the first column of a line

Answer:

(B) You de-indent a line of code to the same indent level as the def keyword  is the correct answer.

Explanation:

The format of writing a function in Python is as follows :-

def the_function_name():

   what_the_function_does  

Proper indentation is necessary.

We start function block with keyword 'def' and give a function name and then we type arguments which gets executed when function is called.

return keyword is also used in function so, as to return the value of some variable to main function if used.

Answered by priyaag2102
1

In Python, de-indentation of a line of code is done to the same indentation level as the def keyword.

Explanation:

  • For an indentation to function properly it is significant for it to be accurate.

  • The function block is initiated with the keyword 'def' is typed and then the function name is inputted and as the arguments are entered they get executed when the function is called.

  • Another keyword used in functions is the “return” keyword, it is employed to return the value of a certain variable to the main function.
Similar questions