13,420
edits
Changes
→INVESTIGATION 3: USING LOOPS
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 the IF Statements 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.
:::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/ELSE/ELIF/ELSE Statements ==
There are many ways to use if statements in more advanced configurations. This section will give a few examples and explain them.