Changes

Jump to: navigation, search

OPS435 Python Lab 3

177 bytes added, 10:03, 2 June 2017
INVESTIGATION 1: CREATING SIMPLE FUNCTIONS
:A very simple definition of using '''functions''' is to create and reuse '''smaller programs within a larger program'''. In programming languages such as '''C''', '''C++''' and '''Java''', commonly used functions are pre-packaged in '''Libraries'''. This relates to dependency issues that were discussed when compiling C programming code in your OPS25 course: if a supporting library is missing, the program would be able to run the called function. We do not go into detail involving Libraries for this course since Python is an '''interpreted''' (i.e. not a compiled) language.
 
: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 a '''"function declaration"'''.
: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"'''.
:== PART 1 - How User-Defined Functions may be designed '''not to accept arguments or return a value''', designed to '''not accept arguments but not return a value''', designed to '''accept arguments are Declared and not return a value''', or designed to '''both accept arguments and return a value'''.Run ==
:Functions may be designed '''not to accept arguments or return a value''', designed to '''not accept arguments but not return a value''', designed to '''accept arguments and not return a value''', or designed to '''both accept arguments and return a value'''. In this investigation, will will focus of creating functions that either do NOT return a value, or return a value.
13,420
edits

Navigation menu