Changes

Jump to: navigation, search

OPS435 Python Lab 1

257 bytes added, 12:43, 18 May 2017
INVESTIGATION 3: WRITING PYTHON SCRIPTS
= INVESTIGATION 3: WRITING PYTHON SCRIPTS =
:During In this investigation we will start writing our very first python scripts. These will be very basic and help us practice syntax and foundation skills, such as: outputting text to the screen, storing data inside variables, and using math operators.
=== PART 1 - Common Introductory Python Functions ===
=== PART 2 - Working with Variables ===
:A variable is used to store data for use later in the program. This data can be a string, integer, decimalnumber, characters, etc. We will only be covering '''string ''' and '''integer variable types ''' variables in this lab. You will learn and use other variable types in future labs.
==== String Variables ====
 
:String variables contain text to be used in your program. Examples of strings could be user-names, full-names, item descriptions, etc. We will now demonstrate to assign a string to a variable and how to display string variables.
:'''Perform the following steps:'''
</source>
:#Let's make a new variable containing a value by issuing the following command:<source>
name = 'Thomas'
</source>
:#Iss the following command to inspect the value of the variable"<source>
::::* The script, when executed, should print out "How old are you Isaac?"
::::*Sample run: <source>
% cd ~/ops435/lab1/% run ./lab1b.py How old are you Isaac?
</source>Try the checking script as you are working through a script to sometimes get hints.<br><br>
<ol><li value="7" style="margin-left:25px;">Download and run the checking script. Enter the following commands from the '''bash shell''':<source>
</ol>
<br><br>
 
= LAB 1 SIGN-OFF (SHOW INSTRUCTOR) =
[[Image:lab1_signoff.png|thumb|right|450px|Students should be prepared with '''all required commands (system information) displayed in a terminal (or multiple terminals) prior to calling the instructor for signoff'''.]]
13,420
edits

Navigation menu