Social

Meet more students

Course policy reminder

Use of computers for non-class activities strictly prohibited, with severe penalties for doing it.

Review of Python learned Day 1

My notebook

Controlling location of notebooks (.ipynb files)

Start notebook by typing this in the Anaconda Prompt:

jupyter notebook --notebook-dir /Users/me/mth337

or to make it permanent, add this line to configuration file

c.NotebookApp.notebook_dir = '/Users/me/mth337‘

Questions?

Euclid's GCD algorithm wrap-up

Examples to try:

31415926534676736647, 438478473847834834784748

31415926534676736647, 3

Acceleration

First exploration: Pythagorean triples

Definition

Primitive

Exercise

Find lots of primitive triples and make a picture of them. See if there are patterns!

Python features needed or useful

iterable objects, such as lists, tuples, ranges

"for" loop

Scatter plot

%matplotlib notebook  # This is a so-called notebook magic command

import matplotlib.pyplot as plt

plt.plot(xlist,ylist,'ro')
plt.show()

Many optional arguments are available to customize plot if desired.

jupyter notebook --notebook-dir /Users/bb1

c.NotebookApp.notebook_dir = '/Users/bb1/Documents/Notebooks/‘