Fundamentals
Contents
1. Fundamentals#
Programming is all about breaking down a problem into simple steps that a computer can understand. In our case the ‘simple steps’ are instructions, written in the Python programming language, which perform operations such as arithmetic calculations or setting the value of variables. These instructions are usually performed one at a time in sequence, although some instructions might cause the program to branch to a different section of code or to repeat a section of code. In this section we will introduce some of the most common Python constructs and some techniques to solve simple computational problems.
What you’ll learn
Perform arithmetic calcuations
Create and use variables
Display output using
print
Conditionally execute instructions using the
if
statementRepeat instructions using the
while
statementUse pseudocode to express the algorithmic solution to a problem
1.1. This Week#
Before class read the notes and complete embedded exercises.
During class work through the workshop.
After class complete and submit the homework.