13,420
edits
Changes
→INVESTIGATION 1: USING FUNCTIONS
= INVESTIGATION 1: USING FUNCTIONS =
:A very simple definition of using '''functions''' is like having '''smaller programs contained inside a larger program''' that can be run by '''function name''' to perform '''repeated or commonly routine tasks'''. In programming languages such as C, C++, and Java, functions (programs) that are very useful are collected in various '''Libraries''' and thus relates to dependency issues that were discussed when compiling C programming code in your OPS25 course. We do not go into detail involving Libraries for this course since Python is an interpreted (i.e. not compiled) language.
:Usually, the '''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 '''"Defining the function"'''.
</source>
:'''Perform the Following steps:'''
print('my number is ' + str(return_number_value()))
</source>
:'''Perform the Following Instructions:'''
:#Create a new script '''~/ops435/lab3/lab3a.py''' and store the following content inside:<source>