Course Overview

Get started with an introductory session for those interested in learning Python, programming, and how to use programming in various mathematical and scientific tasks. Students will install Python 3.8, learn the basics of Python programming, and apply the basics to various tasks. And then gradually expand to computational thinking skills behind software application design.

Session 1

  • Introductory Topics
  • Conditionals
  • Looping
  • Fun projects!

Session 2

  • Functions
  • Modules
  • Object-Oriented Programming

Session 3

  • Python Review
  • Design and Implementation of Games (and Applications)
  • Introducing PyGame – 2-D Graphics Game Design using Python

Curriculum in Detail

AI003 Session#1:Basics of Python

  • Introductory Topics
    1. Basics of Numbers
    2. Basics of Strings
    3. Taking input/output
    4. Variables, arrays, and tuples
    5. Program Flow
  • Conditionals
    1. Booleans and comparators
    2. If-elif-else statements
    3. And/or/not
    4. Nesting
  • Looping
    1. While loops
    2. For loops
    3. For loops v2
    4. Break, continue
  • Fun projects!
    1. Drawing with “turtle“
    2. Statistics with “numpy“

AI003 Session#2:Advanced topic of Python

  • Functions
    1. Desc: Of the math kind and not of the math kind.
  • Modules
    1. Desc: Building projects in pieces.
  • Object-Oriented Programming
    1. Desc: Classic.

AI003 Session#3:Design games and apps (PyGame)

This session aims to reinforce the python basics in a project based curriculum while gradually expanding to introduce computational thinking skills behind software application design. Some previous basics will be reviewed, reintroduced and reinforced, and new topics will be introduced along the way. The project based approach employs a pedagogical sequence: project demo -> requirements analysis -> problem presentation -> solution proposal and implementation -> reinforcement of syntax and coding concepts.

Part I – Python Review

This part aims to review the basics of Python that may have been taught in the prior 32 hours of instruction.

1 – 1.5 hr: Project 1 – Guess the Number

Topics: import • randint() • for • Blocks • str(), int(), float() • Booleans • Comparison • Conditional

1 hr: Project 2 – A Joke-Telling Program

Topics: Escape • ‘ and ” • print()

1 – 2 hr: Project 3 – Dragon Realm

Topics: functions • Multiline strings • while • Boolean operators • return • variable scope • Parameters and arguments • sleep()

Part II – Design and Implementation of Games (and Applications)

This part uses projects of increasing complexity to illustrate the computational thinking behind the design and implementation (including testing) of software applications while reinforcing previously acquired Python basics.

1 hr: Interlude – Using the Debugger

Topics: 3 types of errors • debugger • Go and Quit • Stepping into, over, and out • Breakpoints

1.5 – 2 hr: Project 4a – Designing Hangman with Flowcharts

Topics: ASCII art • Designing with flowcharts

2 – 3hr: Project 4b – Writing the Hangman Code

Topics: Lists • in operator • Methods • split(), lower(), upper(), startswith(), and endswith() • elif

2hr: Project 4c – Extending Hangman

Topics: dict • Key-value pairs •keys() and values() • multi-var assignment

3-4hr: Project 5 – Tic-Tac-Toe

Topics: AI • List references • Short-circuit • None

2-3hr: Project 6 – The Bagels Deduction Game

Topics: random.shuffle() • Augmented assignment operators • sort() • join() • String interpolation • conversion specifier %s • Nested loops

1hr: Interlude – The Cartesian Coordinate System

Topics: x-axis and y-axis • Negative numbers • Pixels • commutativity • abs()

4hr: Project 7 – Sonar Treasure Hunt

Topics: Data structures • Pythagorean theorem • remove() • isdigit() • sys.exit()

2 – 3hr: Project 8 – Caesar Cipher

Topics: Cryptography and ciphers • Ciphertext, plaintext, keys, symbols • Encrypt/decrypt • Caesar cipher • find() • Cryptanalysis • The brute-force

4 – 5hr: Project 9a – The Reversegam Game

Topics: bool() • Simulating moves on a Reversegam board

2 – 3hr: Project 9b – Reversegam AI Simulation

Topics: Simulations • Integer division • round() • Computer-versus-computer games

Part III – Introducing PyGame – 2-D Graphics Game Design using Python

This part introduces the basics of a popular Python library (pygame) as a bridge to the concepts common in computer game development while further developing the students’ software development skills.

1.5 – 2 hr: Project 10 – Creating Graphics

Topics: pygame • Colors and fonts • Aliased and anti-aliased graphics • Attributes • Font, Surface, Rect, PixelArray • Constructor functions • drawing functions • The blit() method for surface objects • Events

1.5 – 2hr: Project 11 – Animating Graphics

Topics: Animating objects with the game loop • Changing the direction of an object

1.5 – 3hr: Project 12 – Collision Detection

Topics: Clock objects • Keyboard input in pygame • Mouse input • Collision • list iteration caveat

1.5 – 3hr: Project 13 – Using Sounds And Images

Topics: Sound and image • Drawing and rescaling sprites • Adding music and sounds • Toggling sound on and off

1.5 – 3hr: Project 14 – A Dodger Game with Sounds and Images

Topics: pygame.FULLSCREEN • move_ip() Rect method