Programming · Beginner

Python online course

A from-scratch path through modern Python: install the interpreter, write readable scripts, and use the tools you will actually need on a workstation.

Who it is for

People who have used a computer but have not written much code.

You should already know

You can install software on Windows or Linux and are comfortable with files and folders.

You will be able to

  • Install Python 3 and confirm it from a terminal
  • Put the interpreter on the Windows PATH
  • Use variables, functions, and control flow
  • Work with lists and dictionaries

Lessons

  1. Install Python 3 Get a current CPython build onto Windows, macOS, or Linux and prove it works.
  2. Add Python to PATH on Windows Learn how to add the folder containing python.exe to the Windows PATH variable, then verify Python from Command Prompt.
  3. Variables and types Names, assignment, and the built-in types you will use in every script.
  4. What are functions? Name a block of work, pass arguments, and return a result you can test.
  5. Control flow Branch with if/elif/else and repeat work with for and while.
  6. Lists and dictionaries Store ordered values and look up records by key.
  7. Add Python to PATH on Windows Learn how to add Python and its Scripts folder to the Windows PATH so python, pip, and version-specific commands work in Command Prompt and PowerShell.
  8. Python Strings Learn Python strings: literals, escapes, indexing, slicing, methods, formatting, Unicode, bytes, parsing, validation, and efficient text construction.
  9. Python String Functions Learn how to inspect, clean, test, and transform Python strings with len(), lower(), upper(), strip(), swapcase(), isdigit(), and islower().
  10. Access Individual Characters and Substrings in Python Learn how Python strings use zero-based indexing and slicing to retrieve individual characters and ranges of characters.
  11. Python Arithmetic Operators Learn Python arithmetic operators for addition, subtraction, multiplication, division, remainders, powers, and floor division with practical examples.
  12. Python Assignment Operators Learn how Python assignment and augmented assignment operators create, update, and reassign variable values with clear examples.
  13. Catch Specific Exceptions in Python Learn how to catch specific Python exceptions with try, except, and else. Handle ValueError, KeyboardInterrupt, multiple exceptions, and invalid user input safely.
  14. Run Python Scripts from the Command Line Learn how to save Python code as a .py file, navigate to its folder, and run it from Windows, Linux, or macOS command-line shells.
  15. Python Comparison Operators Learn how Python comparison operators evaluate values and produce True or False, with examples using numbers, variables, arithmetic, and thresholds.
  16. Display and Inspect Module Contents in Python Learn how to inspect Python modules with dir(), help(), __doc__, inspect.getmembers(), and inspect.signature().
  17. Python Escape Characters in Strings Learn how Python interprets backslashes in strings, including newline, tab, quotation mark, backslash, raw string, and repr() examples.
  18. Find Files and Understand Python Search Paths Learn how Python finds ordinary files and importable modules using pathlib, os, sys.path, PYTHONPATH, and the current working directory.
  19. Get the Current Date and Time in Python Learn how to use Python's datetime module to retrieve, print, format, and work with the current local date and time.
  20. Getting Keyboard Input with Python input() Learn how Python input() reads keyboard text, stores responses in variables, converts values with int() and float(), and supports calculations and if statements.
  21. Python Help Mode: Using the Interactive Help Utility Learn how to use Python's help() utility to explore modules, keywords, topics, objects, attributes, and built-in documentation.
  22. Python Identity Operators: is and is not Learn how Python's is and is not operators compare object identity, how they differ from == and !=, and when to use them safely.
  23. Using the Python IDLE Editor Learn how to open Python IDLE, use its Shell, create and save .py files, run modules, and use IDLE's beginner-friendly development tools.
  24. Importing Modules in Python Learn how to create a local Python module, import a complete module or selected functions, use namespaces and dot notation, and fix common import errors.
  25. Install Python on Linux Learn how to check for Python on Linux and install Python 3 on Debian-based and RPM-based distributions using supported package-management tools.
  26. How to Install Python on Windows Install the latest stable Python 3 release on Windows, configure PATH, verify Python and pip, and learn essential next steps.
  27. Using the Python Interactive Prompt Learn how to start Python in a terminal, use the interactive prompt, understand >>> and ..., troubleshoot PATH issues, and exit the interpreter.
  28. Python Logical Operators: and, or, and not Learn how Python's and, or, and not operators combine and negate Boolean expressions, with truth tables, short-circuiting, truthiness, and practical examples.
  29. Nested Exception Handling Statements in Python Learn nested try/except statements and while-loop validation patterns for safely retrying numeric input in Python.
  30. Nested if Statements in Python Learn how nested if, if-else, and if-elif-else statements work in Python, including indentation, execution flow, input validation, and logical alternatives.
  31. Nested Loop Statements in Python Learn how nested Python loops work, trace outer and inner loop execution, and build a while loop containing a for loop with range().
  32. Python Numeric Variables: Integers, Floats, and Numeric Conversion Learn how Python 3 stores numeric values in variables, uses integers and floats, converts between types, performs division, and handles floating-point precision.
  33. Python Overview: What Python Is and Why to Learn It Learn what Python is, how its readable and portable design works, where it is used, its history, trade-offs, versions, and how beginners can start.
  34. How to Raise Exceptions in Python Learn how to use Python's raise statement for validation, choose useful exception types and messages, catch errors with try and except, and create custom exceptions.
  35. How to Run Python Code: Interactive Shell, IDLE, and Command Line Learn how to run Python code with the interactive prompt, IDLE, and command-line scripts on Windows, Linux, and macOS.
  36. Searching and Inspecting Strings in Python Learn how to count, find, test, and replace text in Python strings with clear examples of count(), endswith(), find(), replace(), and in.
  37. Python Syntax Errors and Logic Errors Learn to distinguish Python syntax errors from logical errors, read diagnostics, and fix common mistakes with practical examples and debugging techniques.
  38. Python break Statement: Exit Loops Early Learn how Python's break statement immediately exits for and while loops, including nested loops, input limits, searches, and break versus continue.
  39. Python continue Statement: Skip the Current Loop Iteration Learn how Python's continue statement skips the rest of the current for or while loop iteration and proceeds with the next one.
  40. Python for Loops: Iterating Over Sequences Learn how Python for loops repeat a block of code for each item in a string, list, or range, including syntax, execution flow, and common mistakes.
  41. Python if, elif, and else Statements Learn how Python if, elif, and else statements choose one branch from multiple alternatives, with menu, range, input validation, and troubleshooting examples.
  42. Python if...else Statements: Choosing Between Two Outcomes Learn how Python if...else statements choose between two code paths using conditions, comparisons, user input, age checks, and even-or-odd examples.
  43. Python if Statements: Making Decisions with Conditions Learn how Python if statements evaluate conditions, use True and False, compare values with ==, and control indented blocks of code.
  44. Python pass Statement Learn how Python's pass statement works as a null operation, when to use it as a placeholder, and how it differs from continue, break, and return.
  45. Python try, except, and else Statements Learn how Python try, except, and else statements handle expected errors, validate input, and run code only after a risky operation succeeds.
  46. Python try, except, and finally Statements Learn how Python try, except, and finally statements handle exceptions and guarantee cleanup code runs after success or failure.
  47. Python try...except Statements: Handling Exceptions Learn how Python try...except handles runtime exceptions, validates integer input, avoids unwanted tracebacks, and separates success and failure paths with else.
  48. Python while Loops Learn how Python while loops repeat code while a condition is true, using counters, sentinel values, input, and safe loop termination.
  49. Types of Errors in Python: Syntax and Runtime Errors Learn how Python syntax and runtime errors differ, read error messages and tracebacks, and troubleshoot examples such as a missing colon and division by zero.
  50. How to Use Comments in Python Learn how to write Python comments with #, use inline and multi-line explanations, and understand the difference between comments, string literals, and docstrings.
  51. Using else Clauses with for and while Loops in Python Learn how Python loop else clauses work with for and while loops, including normal completion, break, continue, searches, validation, and common mistakes.
  52. Use Python for Loops with range() Learn how Python range() controls for-loop iterations with start, stop, and step values, including counting patterns, descending loops, and common errors.
  53. Python Logical Operators: and, or, and not Learn how Python's and, or, and not logical operators combine Boolean conditions in if, elif, and else statements, including ranges, precedence, and short-circuiting.
  54. Python Variable Data Types: Numbers, Strings, Lists, Tuples, and Dictionaries Learn how Python variables refer to values, how dynamic typing works, and how to create, access, modify, inspect, and convert numbers, strings, lists, tuples, and dictionaries.
  55. What Are Modules in Python? Learn what Python modules are, why they are useful, how imports work, where Python finds modules, and how to create and use your own modules.
  56. Python Strings: Creating Text and Using Quotes Learn how Python strings represent text, how to create them with single, double, and triple quotes, and how to use escapes for quotes, newlines, tabs, and backslashes.
  57. What Are Variables in Python? Learn how Python variables bind names to values, how to create, read, print, and reassign them, and how to choose valid variable names.
  58. Write Your First Python Program: Hello, World! Learn to run Hello, World! interactively, create a Python script, save it as hello.py, and run it with Python IDLE.
  59. Add a New Key-Value Pair to a Dictionary in Python Learn how to add a new key-value pair to an existing Python dictionary with bracket assignment, read the value, and avoid common key errors.
  60. Concatenating Strings in Python Learn how to concatenate Python strings with +, add spaces and punctuation, fix str and int TypeErrors, and use str() to build readable text.
  61. Default Parameter Values in Python Functions Learn how Python function default parameter values work with positional and keyword arguments, required parameters, ordering rules, examples, and troubleshooting.
  62. How to Read and Write Files in Python Learn how to create, open, read, write, append to, and safely close text files in Python using open(), file modes, with statements, and UTF-8 encoding.
  63. How to Loop Through a Dictionary in Python Learn how to loop through Python dictionaries with items(), keys(), and values(), unpack key-value pairs, sort entries, and safely delete items while iterating.
  64. Read a File into a List of Lines in Python Learn how to use open(), readlines(), enumerate(), and string methods to load, inspect, clean, and process file lines safely in Python.
  65. Modify Python Lists Learn how to modify Python lists with index assignment, concatenation, append(), extend(), del, and slice deletion.
  66. Python Positional Arguments in Functions Learn how Python matches positional arguments to function parameters, handles required values, and reports missing, extra, or incorrectly ordered arguments.
  67. How to Read Text Files in Python Learn how to open, read, iterate through, and safely close text files in Python with practical examples.
  68. Python Variable Naming Rules and Conventions Learn Python variable name syntax, keywords, case sensitivity, snake_case, built-in shadowing, and practical valid-versus-invalid examples.
  69. Python Variable Scope: Local, Global, Enclosing, and Built-in Names Learn Python variable scope, LEGB name lookup, local and global assignments, enclosing scopes, nonlocal, mutation, shadowing, and common scope errors.
  70. What Are Dictionaries in Python? Learn how Python dictionaries store key-value pairs, create and access entries, update values, handle missing keys, and inspect dictionary contents.
  71. Python Lists: Creating, Indexing, and Slicing Lists Learn how to create Python lists, access items with positive and negative indexes, select ranges with slicing, and modify list values.
  72. Python Sets: Unique, Unordered Collections Learn how Python sets store unique values, remove duplicates, test membership, change contents, and perform union, intersection, difference, and other set operations.
  73. Python Tuples: Immutable Ordered Collections Learn how Python tuples work, including creation, indexing, slicing, immutability, unpacking, dictionary iteration, and tuple versus list choices.