1.8 KiB
1.8 KiB
Return value
TODO: ADD MORE
- the knowledge of
returnstatement could be a useful concept in this exercise variable-length-quantity - the function must return a number (int) hamming
- Most of the functions in the example solution specify a return value using the
returnkeyword. markdown - the exercise must use a
returnstatement to return a value to the caller leap - this function return a string by this line:
return text[::-1]reverse-string - the
returnkeyword is used in a return statement at the end of a function. Exits a function and may or may not pass data or an expression back to calling code. Functions in python without an explicitreturnkeyword and statement will return (pass back) the singleton objectnone. The example code returns a copy of the passed-in argument (assumed to be a string) that has been mapped throughstr.translate(), using the table made fromstr.maketrans()rna-transcription - knowing that functions need not have explicit return statements or values but will return
Noneifreturnis not specified. Except for the two@property-decorated functions, all functions in the example omit an explicitreturnstatement and all returnNone. robot-simulator - the knowledge of
returnstatement could be a useful concept in this exercise variable-length-quantity - "row" and "column" list values are expected from defined instance method(s) matrix