
This course includes our updated coding exercises so you can practice your skills as you learn.
See a demo
Set up Python 3 across Windows, macOS, and Linux, verify the version, and choose a text editor or IDE. Practice writing hello world and follow along with the setup basics.
Discover how Python, an interpreted, portable scripting language, enables quick programs across platforms and explore basics like print commands, quotes, data types, and the __name__ == '__main__' entry point.
Learn how to read and print user input in python, store values in dynamically typed variables, and use print formats and f-strings, plus comments and docstrings to document your code.
Explore Python data types, numerical operations, and assignment operators while building a basic calculator. Learn plus, minus, times, divide, modulus, floor divide, exponent, and complex numbers, booleans, and ASCII characters.
Explore Python strings, their operations from upper and lower case to split, strip, and format outputs using print, format, and f-strings, plus ASCII character codes.
Learn type conversion and in-place operators, including the walrus operator, in Python. Use type to inspect values, and ord/chr for ASCII conversions; explore hex and octal base representations.
Explains python enhancement proposals and the zen of python, highlighting docstring conventions, naming, whitespace, line length, pep8 style, and namespaces for readable code.
Explore boolean expressions, true or false results, and how conditional statements use them. Learn Python's comparison operators, if, elif, and else, plus simple compound conditions with and, or, not.
Learn to chain and nest conditional statements in Python using and and or logic operators. See age-based examples and focus on readability, with if, elif, else and nested conditions.
Explore loops in Python by using while and for constructs, learn range behavior and the in keyword, and master break and continue to control iteration, including step sizes.
Explore functions in Python from simple f(x)=3x to printing hello world, defaults, and keyword arguments. Learn recursion with factorial and summation, using loops, math library, and recursive definitions.
Explore Python's standard library and pip, learn to use math, os, urllib, and turtle modules, and install plotting libraries like matplotlib and NumPy with pip.
Learn how Python handles built-in lists, indexing from zero, and common operations like len, range, list construction, and methods such as append, insert, pop, sort, and copy.
Explore slicing lists, build two-dimensional matrices with lists of lists, and print and traverse them, using start, stop, step indices and negative indexing, with numpy for readability.
Explore Python's built-in dictionaries, a key-value data structure, and learn to create maps, access values by keys, and use methods like keys, values, items, get, and pop.
Explore how Python tuples bundle multiple values and support unpacking into variables, including returning multiple values from functions and using an asterisk to handle extra items.
Explore the itertools library for iterator algebra, including count, cycle, product, permutations, and combinations, with practical examples of finite and infinite iterators.
Discover how Python sets remove duplicates, perform unions and intersections, and apply set concepts to strings and range-based sets for data science.
Explore Python's random number generation and data science tools, including random between bounds, random choice, and seeds; apply NumPy, SciPy, and SymPy to calculus, fast Fourier transform, integration, and optimization.
Explore how Python handles errors by introducing exceptions, raising and catching them, and using common types like type errors, value errors, and syntax errors to enforce input validity.
Learn how Python's try-except-finally constructs catch errors, handle name errors and other exceptions, and use else and finally to keep apps stable.
Explore how assertions provide sanity checks and unit testing to ensure code returns the intended results. See practical examples and error handling, including how graders use assertions to verify programs.
Explore python file I/O by opening files in read, write, append, and read/write modes; learn to seek, read, readline, readlines, and safely close files.
Explore list comprehensions and the ternary operator in Python, using colors as examples and showing how to create, filter, and apply data frames in Pandas in one line.
Explore character matching with Python's regular expressions using the Alice in Wonderland text, learning case sensitivity, anchors, and quantifiers like dot, star, and plus.
Learn data extraction with regular expressions in Python, combining searching and extracting to pull emails from an email conversation file using find all and search.
Explore the escape character in regular expressions, use the backslash to match special characters like the dollar sign, and simulate grep to search files with Python.
Explore object oriented programming with classes, constructors, and instantiation to model points and rectangles, and compute area, perimeter, and volume.
Learn how to define public and private class properties, use the property function to manage access, and import modules and classes for reuse in Python.
Learn data hiding with private attributes and double underscores, and use dunder methods to overload operators, customize string output, and understand object lifecycle and garbage collection.
Explore inheritance in object oriented programming by building parent and child classes, using super, overriding methods, and distinguishing abstract classes and interfaces to structure reusable code.
Discover how class methods bind to the class, not the object, and how static methods bind to the class; class methods access class state, while static methods do not.
Learn to build a basic Python GUI with Tkinter, create a simple area and perimeter calculator, and explore widgets, grid layout, and event-driven updates.
Explore the core ideas of functional programming in Python, including recursion, first-class and higher-order functions, and immutability. See how functions can be passed, stored, and returned.
Explore anonymous functions and lambda expressions in Python, learn one-line function definitions, purity vs impure behavior, and how map and filter leverage these concepts.
Explore iterators, generators, and decorators in Python, using yield and next to control data flow, create custom iterables, and apply decorators that wrap functions for added behavior.
Explore higher-order functions in Python by applying functions to lists with map, filter, and lambdas. See how map transforms elements and how filter selects items.
Master Python's reduce to collapse a list into a single value using lambda or named functions, with sum and product examples and an optional initial value.
Learn how to pass a variable number of arguments in Python with *args and **kwargs, using sums, for loops, and keyword dictionaries to handle non keyword and keyword arguments.
In this course, students will learn elementary programming concepts with the Python (3) language, with an additional section studying Java and the relation between the two languages. Learning Python will allow students to develop the basic skills for functional and object-oriented programming and the fundamentals of polymorphism and imperative programming, as well as a short study on regular expressions. Students can use this knowledge to take on learning other higher-level languages such as C++, Swift, and C# (as well as scripting and scientific languages such as Octave, R, Julia, and Ruby) in an accelerated manner. The class will focus on building programming skills from fundamental keywords to high-level abstraction, in hopes that the student will then continue on to learn a high-level programming language afterward.
Students will learn the following aspects of programming using the Python language:
Section 1:
-Introduction, how to succeed in the course, setup
-What is Python, understanding programming
-Hello World and '__main__'
-Input and Output, Commenting and Docstrings
-Data Types, Arithmetic and Assignment Operators, Numerical Operations
-Strings and String Operations, ASCII
-String Formatting
-Type Conversion, In-Place and Walrus Operators
Section 2:
-PEP and The Zen of Python
-Boolean Expressions and Conditional Statements
-Chained and Nested Conditions
-Logic Operators
-Loops: for, while, 'range', 'in'
-Functions
-Recursion
-The Standard Library and pip
Section 3:
-Lists and List Functions
-List Slices and Matrices
-Dictionaries and Dictionary Functions
-Tuples and Tuple Unpacking
-The 'itertools' Library
-Sets and Set Functions
Section 4:
-Random Numbers, Math and Data Science Functions
-Exceptions and Raising Exceptions
-Exception Handling, 'finally'
-Assertions
-File I/O
-List Comprehensions and Ternary Operator
Section 5 - Regular Expressions:
-Character Matching
-Data Extraction, Combining Searching and Extracting
-The Escape Character and grep
Section 6 - Objected-Oriented Programming:
-Classes
-Properties and Modules
-Data Hiding and Dunder/Magic Methods
-Inheritance
-Class Methods and Static Methods
-Making a basic GUI with Tkinter
Section 7 - Functional Programming:
-Intro to Functional Programming, First-Class Functions
-Anonymous Functions and Lambda Expressions
-Iterators, Generators, and Decorators
-Higher-Order Functions, 'map' and 'filter'
-Using 'reduce'
-Advanced Function Arguments ('*args', '**kwargs')
Section 8 - Capstone:
-Final exam
-Capstone project
Optional textbooks:
-"Practical Programming: An Introduction to Computer Science Using Python 3" by Paul Gries, Jennifer Campbell, and Jason Montojo (Various prices by format and rental, very cheap on Amazon)
-"Python for Everybody: Exploring Data in Python 3" by Charles Severance (Various prices by format and rental, very cheap on Amazon)
-"Python Crash Course, 2nd Edition: A Hands-On, Project-Based Introduction to Programming, 2nd Edition" by Eric Matthes (Various prices by format)