Changes

Jump to: navigation, search

OPS435 Python Lab 2

3 bytes removed, 12:55, 25 May 2017
no edit summary
= INVESTIGATION 1: USER INPUT =
== PART 1 - USER INPUT User Input ==
:In this section, you will learn how to prompt (ask) the user running the program for input or data. Although you will not be immediately be using the information that the user provided, you will use that information later in this lab to change how a Python script works under different situations.
:::3. Before proceeding, make certain that you identify any and all errors in "lab2b.py". When the check script tells you everything is "ok", you may procede to the next step.
== PART 2 - ARGUMENTS Arguments ==
A argument is a value that is passed to a program or passed to a function. In the previous section you passed a argument to the input() function. In this section we will go over the steps of passing a argument to your script, but this time the argument will be passed when we execute your script from the bash shell.
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 Indentation and IF LOGIC Logic==
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.
In programming loops are sequences of code that are repeated multiple times or until a condition is satisfied.
== PART 1 - WHILE LOOPS 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.
:::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 - WHILE LOOPS WITH ARGUMENTS Loops with Arguments ==
''' Understand While Loops and Arguments '''
:::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 3 - WHILE LOOPS WITH Loops With IF STATEMENTS Statement==
''' Practice Using Loops With IF Statements '''
13,420
edits

Navigation menu