Harold Nelson
1/16/2018
Let’s get acquainted with the creator and the community.
https://www.youtube.com/watch?v=YgtL4S7Hrwo
The name “Python” is a reference to the the comedy group Monty Pythons’s Flying Circus. Here’s a famous piece from one of their movies.
https://www.youtube.com/watch?v=IMxWLuOFyZM
When you start Idle, know where the name came from.
Python 3 is installed on all of the computers in the lab. You also probably want to install Python on your own laptop.
https://www.python.org/downloads/
Be sure to install Python 3, not Python 2. You need to adopt a strategy for making what you do on one computer available on others. You could use either a USB drive or something like dropbox.
Start Python by running Idle. Demo.
There are three types of numbers in Python, which we can use in pocket-calculator mode in the Python shell.
An integer is a number without a decimal point.
Operations
Run the following in the Python shell.
3+4
5-2
5*3
5//2
5**3
5%3
These are numbers with decimal points.
Operations
Note that the difference is really in division. The result is complete and no remainder exists.
Run the following in the Python Shell.
5//2
5%2
5/2
Do 1.1 through 1.5 on Page 13.
Do 1.9 through 1.12 on Page
We can use an assignment statement to give names to our numerical objects. Then we can use the names in place of the actual objects in subsequent work.
See example in Session 1.5
x = 3
y = x**2
x = 4
x = 3
y = x**2
x = 4
print(y)
## 9
Names may contain only three things.
A name may not begin with a number.
Names are case sensitive.
You must not use the reserved words in Table 1.1 as names.
Do Problems 1.17, 1.18, 1.20 and 1.21.