Open main menu

CDOT Wiki β

Changes

OPS435 Python Lab 3

46 bytes added, 07:34, 31 May 2017
INVESTIGATION 1: USING FUNCTIONS
:Usually, a '''function''' will '''contain programming code''' in some part of the main program (most likely near the '''top''' of the program '''BEFORE''' the main program). We refer to that as '''"function declaration"'''.
: When a program is run, the '''function's code is read into internal memory''', ready to be run when the function is '''run''' (i.e. referred to as '''calling the function is "called"'''). By Until a Function is specifically told to execute, it'''calling the function''' the function is run automaticallys code will sit (in internal memory) unused.  
:When creating programs that define and use functions, '''a large programming task can be broken-down into smaller elements''' (or '''modules'''). This is why creating programs that use functions is referred to as '''"modular programming"'''.
:Functions may be designed not to accept '''arguments and/or return values'''a value, or designed to not accept arguments but not '''return a value, accept arguments and/not return a value, or both accept arguments and return values'''. Until a Function is specifically told to execute, it's code will sit (in internal memory) unusedvalue
== PART 1 - Using Functions ==
13,420
edits