13,420
edits
Changes
no edit summary
</source>
:::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.
<br><br>
= INVESTIGATION 2: USING LOGIC STATEMENTS =
:In computer programming, control flow statement can be used to change the direction (flow) of a program. In this section, you will focus on LOGIC control flow statements that are used to change the way each script runs, based entirely on input (either user input, or command arguments). In this section, we will discuss several LOGIC control flow statements including: IF, and IF/ELIF/ELSE.
sys.exit()
</source>What happened? This IF statement means: IF the number of arguments(one) is NOT EQUAL to ten, then the condition is True. It is HIGHLY recommended to experiment by issuing different test conditions using the IF statement, until you become more familiar with it, prior to proceeding with this lab. NOTE: If you are running this in ipython3, the number of arguments will be always be '1'. This number will always be one higher than the actual number of arguments entered. This is because it also counts the script name as a argument.
<blockquote style="margin-left:35px;">{{Admon/important|style="padding-left:25px"|Number of Arguments with len(sys.argv)|If you are running this in ipython3, the number of arguments will be always be '1'. This number will always be one higher than the actual number of arguments entered. This is because it also counts the script name as a argument.}}</blockquote>
''' Practice Using If Statements '''