Open main menu

CDOT Wiki β

Changes

OPS435 Python Lab 2

18 bytes added, 18:01, 25 May 2017
PART 2 - IF/ELSE/ELIF
:::4. Before proceeding, make certain that you identify any and all errors in "lab2c.py". When the check script tells you everything is "ok", you may procede to the next step.
= INVESTIGATION 2: USING IF LOGIC STATEMENTS =
In computer programming an "if statement" is a condition that executes different code based on whether the condition is True or False. In this section "if statements" will be used to change the way each script runs, based entirely on the output we provide.
== PART 1 - Indentation and the Using IF StatementStatements ==
Indentation means to start a line with spaces or tabs before your text. In Python, indentation can control how the program itself runs. From now on be very careful and consistent in the indetation that you make. Using indentation you can choose what code runs as part of the if statement and what code runs as part of the main program.
:::3. Before proceeding, make certain that you identify any and all errors in "lab2d.py". When the check script tells you everything is "ok", you may procede to the next step.
== PART 2 - Using IF/ELIF/ELSE/ELIF Statements ==
There are many ways to use if statements in more advanced configurations. This section will give a few examples and explain them.
</source>
= INVESTIGATION 3: USING LOOPS LOOP STATEMENTS =
In programming loops are sequences of code that are repeated multiple times or until a condition is satisfied.
13,420
edits