{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Workbook for Chapter 3 of Explorations in Computing" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Section 3.1: The Algorithm" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##### Execute these cells to initialize the notebook:" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "from PythonLabs.SieveLab import *" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "%matplotlib tk" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##### Exercises " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "T1. Using paper and pencil, follow the steps in the algorithm to make a list of prime numbers less than 50. Write your answers in the markdown cell below:" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "T2. You can check your results with a version of `sieve` defined in the lab module for this chapter. Tell Python to call the `sieve` function to make a list of primes up to 50:" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "♦ How many passes did you make over the full list before you were left with all prime numbers?" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.4.2" } }, "nbformat": 4, "nbformat_minor": 0 }