Open main menu

CDOT Wiki β

Changes

OPS435 Python Lab 3

393 bytes added, 10:27, 31 May 2017
PART 2 - Providing Functions With Arguments
:#Start the ipython3 shell:<source>
ipython3
</source>When using functions in Python accept arguments, you MUST contain strings, numerical values or variable names within the function's '''brackets'''.<br><br>NOTE:#To create Normally, when a new function is declared that accepts arguments, provide those arguments must be declared (using variable names). Those declared variable names are then used in the functions bracketsfunction for processing. But if Also, when you call a function is given with arguments, the number of arguments in passed up to the definition, it function must always get correspond (match) the same number of arguments when you call that were specified in the functiondeclaration.<br><br>:#Enter the following to declare the function called '''square()''':<source>
def square(number):
return number ** 2
13,420
edits