Week 3: September 12 - 16

Prime Numbers

Starting with the definition of a prime number, we develop ways to check if an integer is prime.

Prime Spirals

We explore a way to plot the postive integers that highlights the uneven distribution of prime numbers.

Python

  • Modulus operator %
  • break
  • continue
  • List concatenation
  • List indexing and slicing
  • List comprehensions
  • len

Matplotlib

  • text
  • xlim, ylim
  • xticks, yticks

Quiz 2: Conditional Code and Functions

  • if statement
  • def statement
  • import statement
  • dir function
  • Comments

Sample Quiz 2

Report 2

Prime Spirals