Open main menu

CDOT Wiki β

Changes

OPS435 Python Lab 2

7 bytes added, 19:00, 25 May 2017
PART 1 - Indentation and IF Logic
:::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 LOGIC IF 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 - Using Indentation and the IF Statement==
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.
13,420
edits