{ "cells": [ { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# Python for Computer Science\n", "> wichit2s" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "## Programming Paradigms \n", "\n", "| Paradigm | Description | Languages |\n", "|:----------------|:---------------------------------------|:------------------------------------------------------|\n", "| Imperative | statements change state directly | C, C++, Java, PHP, **Python**, Ruby |\n", "| Structured | imperative + logical structure | C, C++, Java, **Python** |\n", "| Procedural | structure + modular programming | C, C++, Lisp, PHP, **Python** |\n", "| Functional | computation as math functions | C++, Clojure, JavaScript, Lisp, **Python**, Ruby, Scala |\n", "| Event-Driven | control flow by events | JavaScript, ActionScript, Visual Basic, Elm |\n", "| Object-Oriented | data as object control through methods | C++, C#, Java, JavaScript, PHP, **Python**, Ruby, Scala |\n", "| Declarative | program logic (fourth-gen) | SQL, regex, CSS, Prolog |\n" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "### Chapters\n", "\n", "| First Half | Second Half |\n", "|:-------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------|\n", "| 1. [Computers and Programs](http://mcsp.wartburg.edu/zelle/python/ppics3/slides/Chapter01.pptx) | 7. [Control Structure 1](http://mcsp.wartburg.edu/zelle/python/ppics3/slides/Chapter07.pptx) |\n", "| 2. [Writing Simple Programs](http://mcsp.wartburg.edu/zelle/python/ppics3/slides/Chapter02.pptx) | 8. [Control Structure 2](http://mcsp.wartburg.edu/zelle/python/ppics3/slides/Chapter08.pptx) |\n", "| 3. [Computing Numbers](http://mcsp.wartburg.edu/zelle/python/ppics3/slides/Chapter03.pptx) | 9. [Simulation and Design](http://mcsp.wartburg.edu/zelle/python/ppics3/slides/Chapter09.pptx) |\n", "| 4. [Computing Strings](http://mcsp.wartburg.edu/zelle/python/ppics3/slides/Chapter04.pptx) | 10. [Defining Classes](http://mcsp.wartburg.edu/zelle/python/ppics3/slides/Chapter10.pptx) |\n", "| 5. [Object and Graphics](http://mcsp.wartburg.edu/zelle/python/ppics3/slides/Chapter05.pptx) | 11. [Data Collections](http://mcsp.wartburg.edu/zelle/python/ppics3/slides/Chapter11.pptx) |\n", "| 6. [Defining Functions](http://mcsp.wartburg.edu/zelle/python/ppics3/slides/Chapter06.pptx) | 12. [Object-Oriented Design](http://mcsp.wartburg.edu/zelle/python/ppics3/slides/Chapter12.pptx) |\n", "| | 13. [Algoirhtm Analysis and Design](http://mcsp.wartburg.edu/zelle/python/ppics3/slides/Chapter13.pptx) |\n" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "### 1. Computers and Programs [Lecture](./01 Computers and Programs.ipynb) [Lab](./01 Computers and Programs Lab.ipynb)\n", "\n", "| Lectures | Laboratory |\n", "|:---------------------------- |:------------------------|\n", "| 1. The Universal Machine | 1. Anaconda Installation |\n", "| 2. Program Power | 2. Python Shell |\n", "| 3. What is Computer Science? | 3. IPython Shell |\n", "| 4. Hardware Basics | 4. Jupyter Notebook |\n", "| 5. Programming Languages | |\n", "| 6. The Magic of Python | |\n", "| 7. Inside a Python Program | |\n", "| 8. Exercises | |\n" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "### 2. Writing Simple Programs [pptx](http://mcsp.wartburg.edu/zelle/python/ppics3/slides/Chapter02.pptx) [Lab](02 Writing Simple Programs Lab.ipynb)\n", "| Lectures | Laboratory |\n", "|:--------------------------------------------------------------------------|:------------|\n", "| 1. The Software Development Process | |\n", "| * **Example Program**: Temperature Converter | |\n", "| 2. Elements or Programs: Names, Expressions | |\n", "| 3. Output Statement | |\n", "| 4. Assignment Statements: Simple, Assigning Input, Simultaneous Assignment | |\n", "| 5. Definite Loops | |\n", "| * **Example Program**: Future Value | |\n", "| 6. Exercises | |\n" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "### 3. Computing with Numbers [pptx](http://mcsp.wartburg.edu/zelle/python/ppics3/slides/Chapter03.pptx) [Lab](03 Computing with Numbers Lab.ipynb)\n", "| Lectures | Laboratory |\n", "|:------------------------------------|:-----------|\n", "| * Numeric Data Types | |\n", "| * Using The Math Library | |\n", "| * Accumulating Results: Factorial | |\n", "| * The Limits of Int | |\n", "| * Handling Large Numbers: Long Ints | |\n", "| * Type Conversions | |\n", "| * Exercises | |\n" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# 4. Computing with Strings [pptx](http://mcsp.wartburg.edu/zelle/python/ppics3/slides/Chapter04.pptx) [Lab](04 Computing with Strings Lab.ipynb)\n", "| Lectures | Laboratory |\n", "|:--------------------------------|:-----------|\n", "| * The String Data Type | |\n", "| * Simple String Processing | |\n", "| * Strings and Secret Codes | |\n", "| * Output as String Manipulation | |\n", "| * File Processing | |\n", "| * Exercises | |\n" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "## 5. Objects and Graphics [pptx](http://mcsp.wartburg.edu/zelle/python/ppics3/slides/Chapter05.pptx) [Lab](05 Objects and Graphics Lab.ipynb)\n", "\n", "| Lectures | Laboratory |\n", "|:----------------------------|:-----------|\n", "| * The Object of Objects | |\n", "| * Graphics Programming | |\n", "| * Using Graphical Objects | |\n", "| * Graphing Future Value | |\n", "| * Choosing Coordinates | |\n", "| * Interactive Graphics | |\n", "| * Graphics Module Reference | |\n", "| * Exercises | |\n" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "### 6. Defining Functions [pptx](http://mcsp.wartburg.edu/zelle/python/ppics3/slides/Chapter06.pptx) [Lab](06 Defining Functions Lab.ipynb)\n", "| Lectures | Laboratory |\n", "|:---------------------------------------------|:-----------|\n", "| * The Function of Functions | |\n", "| * Functions, Informally | |\n", "| * Future Value with a Function | |\n", "| * Functions and Parameters: The Gory Details | |\n", "| * Functions that Return Values | |\n", "| * Functions and Program Structure | |\n", "| * Exercises | |\n" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "### 7. Control Structures, Part 1 [pptx](http://mcsp.wartburg.edu/zelle/python/ppics3/slides/Chapter07.pptx) [Lab](07 Control Structures Part 1 Lab.ipynb)\n", "| Lectures | Laboratory |\n", "|:-------------------------------------|------------|\n", "| * Simple Decisions | |\n", "| * Two-Way Decisions | |\n", "| * Multi-Way Decisions | |\n", "| * Exception Handling | |\n", "| * **Study in Design**: Max of Three | |\n", "| * Exercises | |\n" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "### 8. Control Structure, Part 2 [pptx](http://mcsp.wartburg.edu/zelle/python/ppics3/slides/Chapter08.pptx) [Lab](08 Control Structures Part 2 Lab.ipynb)\n", "| Lectures | Laboratory |\n", "|:--------------------------------------------------------------------------------------------|------------|\n", "| * For Loops: A Quick Review | |\n", "| * Indefinite Loops | |\n", "| * Common Loop Patterns: Interactive, Sentinel, File, Nested | |\n", "| * Computing with Booleans: Operators, Algebra | |\n", "| * Other Common Structures: Post-Test Loop, Loop and a Half, Boolean Expression as Decisions | |\n", "| * Exercises | |\n" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "### 9. Simulation and Design [pptx](http://mcsp.wartburg.edu/zelle/python/ppics3/slides/Chapter09.pptx)\n", "| Lectures | Laboratory |\n", "|:-------------------------------------------------------------------------------------------------------|------------|\n", "| * Simulating Racquetball: problem, specification | |\n", "| * Random Numbers | |\n", "| * Top-Down Design: Top-Level, Separation of Concerns, Second-Level, Third-Level, Finishing Up, Summary | |\n", "| * Bottom-Up Implementation: Unit Testing, Simulation Results | |\n", "| * Other Design Techniques: Prototyping and Spiral Development, The Art of Design | |\n", "| * Exercises | |\n" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "### 10. Defining Classes [pptx](http://mcsp.wartburg.edu/zelle/python/ppics3/slides/Chapter10.pptx)\n", "| Lectures | Laboratory |\n", "|:------------------------------------------------------------------------------|------------|\n", "| * Quick Review of Objects | |\n", "| * Example Program: Cannonball, program specification, designing, modularizing | |\n", "| * Defining New Classes | |\n", "| * Object and Encapsulation: Encapsulating useful abstractions, Modules | |\n", "| * Example Program: | |\n", "| * Exercises | |\n" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "### 11. Data Collections [pptx](http://mcsp.wartburg.edu/zelle/python/ppics3/slides/Chapter11.pptx) [Lab](11 Data Collections Lab.ipynb)\n", "| Lectures | Laboratory |\n", "|:----------------------------------------------------|------------|\n", "| * Example Problem: Simple Statistics | |\n", "| * Applying Lists: sequences, vs. string, operations | |\n", "| * Statistics with Lists | |\n", "| * Combining Lists and Classes | |\n", "| * Case Study: Python Calculator | |\n", "| * Non-Sequential Collections: Dictionary | |\n", "| * Exercises | |\n" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "### 12. Object-Oriented Design [pptx](http://mcsp.wartburg.edu/zelle/python/ppics3/slides/Chapter12.pptx)\n", "| Lectures | Laboratory |\n", "|:--------------------------------------------------------|------------|\n", "| * The Process of OOD | |\n", "| * Case Study: Racquetball Simulation | |\n", "| * Case Study: Dice Poker | |\n", "| * OO Concepts: Encapsulation, Polymorphism, Inheritance | |\n", "| * Exercises | |\n" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "### 13. Algorithm Analysis and Design [pptx](http://mcsp.wartburg.edu/zelle/python/ppics3/slides/Chapter13.pptx)\n", "| Lectures | Laboratory |\n", "|:--------------------------------------------------------------------|------------|\n", "| * Searching: Linear, Binary, Comparison | |\n", "| * Recursive Problem-Solving: definition, recursive function, search | |\n", "| * Sorting Algorithms: Selection, Merge, Comparison | |\n", "| * Hard Problems: Towers of Hanoi, The Halting Problem | |\n", "| * Exercises | |\n" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "### keywords\n", "\n", "| Control | Class/Scope | Exception | Constants | Logic |\n", "|:--------------:|:-----------:|:---------:|:------------:|:-----:|\n", "| `if,elif,else` | `class` | `try` | `True,False` | `and` |\n", "| `while` | `import` | `except` | `None` | `or` |\n", "| `for` | `global` | `finally` | | `in` |\n", "| `yield` | `nonlocal` | `assert` | | `is` |\n", "| `continue` | `lambda` | `raise` | | `as` |\n", "| `break` | | | | |\n", "| `del` | | | | |" ] } ], "metadata": { "celltoolbar": "Slideshow", "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.5.2" } }, "nbformat": 4, "nbformat_minor": 2 }