Open main menu

CDOT Wiki β

Changes

OPS435 Python Lab 3

55 bytes added, 09:08, 2 June 2017
PART 2 - Providing Functions With Arguments
:#Start the ipython3 shell:<source>
ipython3
</source>When using passing arguments up to functions in Python accept arguments, you MUST contain data such as '''strings''', '''numbers''', numerical values or '''variable names ''' within the function's '''brackets'''immediately following the function name.<br><br>'''NOTE: ''' Normally, when a function is declared that accepts arguments, those '''arguments must be declared ''' (using variable names). Those declared variable names are then used in within the function for processing. Also, when you call a function with arguments, the number of arguments passed up to the function must correspond (match) the number of arguments that were specified in the function declaration.<br><br>
:#Enter the following to declare the function called '''square()''':<source>
def square(number):
13,420
edits