MENU
Question -

How do we define a function ?



Answer -

Here are simple rules to define a function in Python.

● Function blocks begin with the keyword def followed by the function name and Parentheses ()
● Any input parameters or arguments should be placed within these parentheses.
● The first statement of a function can be an optional statement – the documentation string of the function or docstaing.
● he code block within every function start with color(:) and is indented.
● The statement return [expression] exits a function, optionally passing back an expression to the caller. A return statement with no arguments is the same as return none.

Comment(S)

Show all Coment

Leave a Comment

Free - Previous Years Question Papers
Any questions? Ask us!
×