11: Objects and Classes

Introduction Objects can be one of the most difficult programming concepts to understand. Once it clicks, however, it really clicks. I recommend you read and pay close attention to the textbook, and utilize your resources until you understand objects and classes, as your upcoming evaluation will rely heavily on your understanding of these concepts. Before you begin, please read the Python documentation 9.2. Python Scopes and Namespaces. This stuff messes a lot of people »

10: The While Loop

Introduction This will be a short tutorial, as while loops are pretty easy. You MUST understand conditionals to continue. While loops rely on an expression to operate. As long as the expression is True, the loop will run. When the expression stops being True (ie. it is False), so does the loop. WHILE loop structure The basic structure of a while loop is as follows: while (expression): # Do something This will execute the code inside »

09: Conditionals

Introduction Loops, functions, and methods have allowed us to deal with a wide range of problems. Usually, these problems have a simple logic flow, which usually involves taking data, performing some action, then outputting the data in some manner (print, write, etc.). Although these skills are important, there are still many problems we are unable to solve. Digital logic provides a way of thinking that allows us to break complex (often non-numerical) problems into smaller »

Midterm Preparation

Hey everyone, sorry this is late. I did intend for this to be available closer to the midterm date, but here it goes! Things to Remember 1. Read the Question! No matter how many times I remind students to read the whole problem before answering (see: every lab so far), many people attempt to solve the problem before reading the whole question. You can’t answer a question you don’t understand. Take a breath, »

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 »