Open main menu

CDOT Wiki β

Changes

OPS435 Python Lab 2

12 bytes removed, 09:48, 26 May 2017
PART 1 - WHILE Loops
:In the first two labs, you have been exposed to tools and methods to write powerful Python scripts. In Lab1, this included using using variables. In Lab 2 you learned how to input variables by either prompting the user for input or using data that are arguments containing within a Python script that you run. You also learned about LOGIC control-flow statements in order to make the Python script behave differently based on differing input.
:You will now complete start to learn about the second major category of control flow statements by learning how to repeat a command or a series of commands. Although, you will be learning other scripting techniques, the ability to know how to use variables, LOGIC and LOOPING control-flow statements will allow you to create useful and powerful programs to assist you when managing your computer system (including virtual machines).
== PART 1 - Understanding WHILE Loops ==
While loops use a the same type of conditions found in if statements. While the condition is True, the code indented under the while loop will be repeated. When the condition becomes False the loop will stop repeating.
''' Understanding While Loops '''
:'''Perform the following steps'''
:#Open ipython3<source>
13,420
edits