06: Extra Project 1: Grade Calculator

By now you’re all pretty familiar with Python. We’ve seen how it can be used as a calculator, how it can handle large sets of information with the help of lists and FOR loops, but there’s still so much more we can do with Python (as well as other languages). You will notice the labs begin to add these elements together, so here’s a little DIY project to follow along and »

05: Handling Files

Introduction Saving and transferring information can be difficult when done exclusively inside a program. Though it is faster, the stored data often dies with the program. A basic way around this is seen in things like Cookie files, where the browser stores some information to your computer in a RTF (Rich Text File). Let’s see how we can read and write to such files. Loading the File Python makes it pretty easy to load »

04: Mathematical Formulae

We’ve seen how Python can be used as a simple calculator. We have expressions for basic functions (multiplication, addition, etc.); but what if we wanted to do something more complex? Let’s take a look at Python’s math library. Setting Up “Math” To access the math library, you’ll first have to import the library to your current programming session. Use an import statement at the top of your new document. import math »

03: Lists

Introduction Many programming tasks require the programmer to manipulate data in many ways. Often, we are given a finite set of data and must perform some sort of operation on it (arithmetic, sorting, etc.). Let’s look at one way to handle sets of information in Python. Let’s say we’re given a grocery list, and told to store it into a single variable, groceryList. Python has a built in data type called a »

02: The For Loop

Introduction In all areas of business, there are often times where we need to repeat a single task several times. Sometimes, we have to do something two or three times before we can really say we’re “done”. Even more often, however, are times when we must repeat ourselves hundreds or thousands of times! Let’s say we have a simple example, where we must start with the number 20 and must subtract one from »