
Master Python basics, from syntax and types to Python's object model. Learn control statements, conditionals, loops, functions, generators, decorators, and the module system with an example web application.
Copy and organize the course exercise files to your system, then create working copies and run them in your editor or development environment. Experiment freely to deepen your Python learning.
Explore python three, an object oriented scripting language guided by readability and simplicity. Learn its philosophy, key differences from python two, and how to write clear, efficient code.
Install Python 3 on Mac and set up Komodo Edit (free version) to run Python scripts, configure UTF-8 encoding for Python and Python3, and test with a Hello-Dash script.
Install Python 3 on Windows and set up the free Komodo Edit for Python development. Configure utf eight unicode encoding and create a run command to run Python scripts.
Explore a bird's-eye view of Python syntax, highlighting indentation, objects, and the absence of braces and semicolons. Build familiarity with the language's structure to prepare for detailed features later.
Learn how the hello world program validates your Python development environment by using the print function to display hello world and verify the interpreter and tool chain.
Explore the anatomy of a Python script, from comments and the shebang line to imports, the print function, and a common main-guard pattern that governs execution.
Explore the difference between statements and expressions in Python, with examples of assignments, function calls, and tuples, and learn why one statement per line enhances clarity.
Learn how Python uses whitespace to define blocks through indentation, and how functions, prints, and comments interact, including end-of-line significance and single-line comments.
Demonstrate printing literals and variables in Python, using the format method with placeholders and f-strings for Python 3.6+ interpolation, while contrasting legacy Python 2 syntax.
Python uses indentation to define blocks, as with if statements, and blocks do not define scope, so variables remain accessible outside the indented block.
Explore Python conditionals with if, else, and elif, including one-line conditionals and indentation, showing how to print based on comparisons and why Python lacks a switch statement.
Learn how while loops and for loops control execution in Python, with practical examples like iterating over lists, printing elements, and generating a Fibonacci sequence.
Learn how Python defines and calls functions using def, handles arguments, defaults, and return values, including None, with primes and range examples.
Define a class and create an object to show methods and properties. Use self and dot notation to call quack and walk, illustrating object oriented programming in Python.
Explore Python's fundamental built-in types using the type function, with hands-on examples of int, float, string, boolean, and none types, and learn how dynamic typing applies to values.
Examine that strings are objects in Python, compare single, double, and triple quotes, and learn formatting with format and f-strings (Python 3.6+), including alignment and leading zeros.
Explore Python's numeric types, including int and float, and how Python 3 handles division and modulo. Learn to use the decimal module for accurate money calculations rather than floating points.
Explore the bool type and its true and false values; none signals absence, and zero or empty strings evaluate as false, while nonzero numbers and nonempty strings evaluate as true.
Explore Python's built in sequence types, including lists, tuples, and dictionaries, with mutability and indexing. Learn to use range, for loops, and items to access keys and values.
Learn how Python treats everything as an object, using type and is instance for type checks. Use id to identify objects and inspect element types in tuples, lists, and strings.
Master Python's conditional syntax with if, elif, and else, using booleans and equality checks, exploring indented blocks and cascading conditions, and comparing to switch statements.
Master Python's conditional operators, including comparison (==, !=, <, >, <=, >=), logical (and, or, not), identity (is, is not), and membership (in, not in) for conditional expressions.
Explore Python's ternary conditional operator with examples, showing how the hungry flag selects between 'feed the bear' and 'do not feed the bear', and why an else clause is required.
Explore Python arithmetic operators, including addition, subtraction, multiplication, division, integer division, remainder, exponent, and unary negative and positive operators, noting Python 3 division yields floats and // and % behaviors.
Explore Python's bitwise operators—and, or, xor, and shift left or right—that operate on individual bits in numbers, with hex and binary demonstrations, not the logical operators used for conditional constructs.
Explore Python's comparison operators: less than, greater than, less than or equal, greater than or equal, equal, and not equal, and how they compare two operands in code examples.
Explore Python's boolean operators and, or, not; test membership with in and not in; compare identity with is and is not, and learn how strings yield the same object.
Understand how Python's operator precedence shapes expression results, with examples like 2 + 4 * 5, and learn to use parentheses to enforce the intended order.
Learn how Python while loops use a conditional expression to control execution and how Python for loops iterate over a sequence, ending when the sequence is exhausted.
Learn how the while loop uses a conditional expression to control repetition in Python, using input to compare user entry with a secret value like swordfish to end the loop.
Master the for loop by iterating over sequences such as tuples and ranges, assigning items to a variable and printing them, with practical comparisons to while loops.
Learn continue, break, and else in while and for loops. Use continue to shortcut iterations, break to exit early, and else to run only when the loop ends.
Understand how Python functions work, including defining with def, passing parameters, returning values (or none), and using __name__ == '__main__' to control module execution.
Understand how Python passes function arguments, including positional and default values, and how mutable versus immutable objects affect calls, with call-by-value versus call-by-reference behavior.
Explore python variable length argument lists with *args, treating them as tuples, and learn to print items or a default meow when none are provided.
Master keyword arguments and the double-asterisk syntax for passing a variable number of named arguments as dictionaries. Learn to pass a dict with ** and follow kwarg conventions.
Explore how Python functions return values, including None, numbers, lists, and dictionaries, and understand how return statements shape a function’s output.
Learn how generators yield a stream of values, using a range-like example and an inclusive range variant. Explore argument handling for one to three args and use of type errors.
Learn how decorators use metaprogramming to wrap a function with a wrapper, turning functions into objects, showing scope and decorator syntax, and enabling timing via an elapsed time decorator.
Explore Python's basic data structures, including lists (mutable sequences), tuples (immutable), dictionaries (key-value pairs), and sets (unordered, unique values), with syntax using brackets, parentheses, and curly braces.
Learn how lists and tuples differ in Python, exploring mutability, indexing, slicing, joining, and common operations like append, insert, remove, pop, delete, and length.
Python's dictionary type is a hashed key-value structure. Create dictionaries with curly braces or the constructor, access by key, and use items, keys, values, and get.
Learn how python sets store unique, unordered elements and support membership checks; perform difference, union, and exclusive or with -, |, and ^ operators, with optional sorting.
Explore list comprehension in Python by building lists from range, multiplying elements by two, filtering elements not divisible by three, and creating tuples, dictionaries, and sets.
Explore how in Python everything is an object and variables store references, letting mixed structures like lists, tuples, sets, ranges, and dicts hold diverse data.
Define and instantiate a Python class, using self, indentation, and the dot operator to access object data and methods like quack, printing sound and movement.
Learn how to create objects by calling a class as a function and how the constructor initializes attributes with self, type, name, and sound.
Discover how class methods serve as the primary interface to objects, using a getter setter pattern with self, underscore private variables, and the __str__ special method to represent instances.
Learn the difference between class variables and object variables, and how encapsulation uses getters and setters with underscore conventions to protect object data in Python.
Explore class inheritance in python, where a base class provides properties and methods to derived classes via super. See duck and kitten subclasses, exception checks in setters/getters, and overriding str.
Explore iterator objects in Python by building an inclusive range iterator, comparing it with the built-in range and generators, and understanding stop iteration and type errors.
Learn how exceptions report runtime errors in Python, inspect tracebacks, and use try and except blocks to catch value errors and continue execution.
Use exceptions to report runtime errors by raising type errors for wrong argument counts and handling them with try/except to show clear error messages and tracebacks.
Explore how Python 3 treats strings as first-class objects, enabling methods on literals such as upper and swapcase, and supports formatting with placeholders across single, double, and triple quoted strings.
Explore common Python string methods, including upper, lower, capitalize, title case, swap case, and case fold. Learn about string immutability and concatenation, plus Unicode considerations like the German sharp s.
Explore Python string formatting using the format method and f-strings, with placeholders, positional and named arguments, alignment, padding, signs, commas, bases, and decimal precision.
Split and join strings in Python using separators, showing default space folding and how to split on a character or join with a colon.
Learn how to use python's open function to read files line by line, strip newline characters, and understand modes such as r, w, a, plus, and text or binary.
Explore how text and binary file modes handle diverse line endings across systems, including newline, line feed, and carriage return, and how Windows, Unix, and legacy platforms differ.
Learn to read and write text files in Python using open in read mode and text mode, strip line endings, and write with print or write_lines, then close the files.
Copy a binary file by reading and writing in binary mode with a fixed-size buffer, using a loop that processes ten kilobytes per iteration to produce an identical output.
Explore Python's numeric functions, including int and float constructors, abs, divmod, and complex numbers with the complex constructor using j notation.
Explore how the Python standard library's string oriented functions extend string behavior, including repr and representation, ASCII escaping, and ord/chr for Unicode characters.
Explore container functions in the Python standard library by creating tuples, converting to lists, and using len, reversed, sum, max, min, any, all, zip, and enumerate.
Explore Python built-in functions for classes and objects, including type, isinstance, and id, via a Hello.py example that inspects object identities.
Import and use standard library modules to access platform info, environment variables, and the current working directory. Generate random numbers, shuffle lists, and inspect date and time with datetime.
Design a reusable Python module that prints the time in words, using a data-driven word dictionary and unit tests. Build inheritance-based classes to convert numbers to words and format times.
Connect to a Python database with sqlite3 and the Python DB API, obtain a cursor, and execute SQL to create tables, insert rows, and query counts.
Build a practical Python database interface using the sqlite3 module, featuring docstring-driven methods, property decorators for file handling, and CRUD operations with commit options, including an in-memory database for testing.
Equip students with basics to write effective Python scripts, covering syntax, types, conditionals, loops, functions, generators, decorators, and the rich object model for reusable code.
Python for Beginners: A Step-by-Step Journey into Programming
Are you ready to embark on an exciting adventure into the world of programming? Look no further! This comprehensive Python course is tailor-made for beginners, offering an immersive learning experience that will demystify coding and empower you to build your own Python projects from scratch.
Python—the popular and highly-readable object-oriented language—is both powerful and relatively easy to learn. Whether you're new to programming or an experienced developer, this course can help you get started with Python. This Python course provides an overview of the installation process, basic Python syntax, and an example of how to construct and run a simple Python program. Learn to work with dates and times, read and write files, and retrieve and parse HTML, JSON, and XML data from the web.
In this course, we will start with the basics, introducing you to the Python language and its vast capabilities. You'll gain a solid understanding of Python's simple and elegant syntax, perfect for those with little or no prior programming experience.
We'll dive into fundamental concepts, such as variables, data types, conditional statements, and loops, empowering you to write logical and efficient code. You'll learn how to control the flow of your programs, making decisions and executing repetitive tasks with ease.