Variables and conditionals
Contents
2. Variables and conditionals¶
Teaching goals
In this part you will learn to
use an editor to write and execute a Python program.
use and understand variables and data types
use arithmetic operators on different data types
use and understand the structure of conditionals
In this part we will take a look at two of the most basic structures in programming: variables and conditionals. If you are familiar with these structures in Python, you can skip the theoretical part and go straight to the questions regarding teaching at the end of each page. Feel also free to skip the section below about what programming is and how to use an editor.
2.1. Programming with an editor¶
In the video below we will show how to use an editor to write and execute Python code. You can download Python and an editor through the Anaconda distribution. Just , and you have everything you need for now. In all modules we have also included an interactive, built-in editor called Trinket, which you may use throughout the course.
Caution
Main points Make sure you have the following under control
installing an editor
writing code in an editor
executing code in an editor
Get to know the editor by trying out some options and exploring the different panels.