Open main menu

CDOT Wiki β

Changes

OPS435 Python Lab 3

12 bytes added, 08:26, 2 June 2017
PART 1 - Using Functions
number = return_number_value()
print(str(number))
</source>'''NOTE:''' The IF statement prior to the statements in the '''Main main section''' of (below the function definitions) in the '''lab3a.py''' script above is considered to be a '''special IF statement'''. It allows scripts to be '''importedvariables''' and '''functions''' into from other python scripts to be '''used in your current Python script (or in the ipython shell environments so they can be used ) without having to add re-define those functions into your current Python script'''. In order to use functions from other scripts, you are required to either issue the import command in your ipython3 shell environment, or use the import command within your Python script itself.<br><br>
:::2. Run your lab3a.py script in your ipython3 shell by issuing:
::::<source>
13,420
edits