Beginner · 4h 50m · lessons

Python Basics

Write your first real programs in the friendliest language there is.

What you'll learn

  • Run Python two ways: line-by-line in the REPL and as saved .py scripts
  • Store data in variables and tell apart the core types: int, float, str, bool
  • Build and format text cleanly with f-strings and the handy string methods
  • Collect data with lists, tuples, dictionaries, and sets — and pick the right one
  • Make decisions with if/elif/else and repeat work with for and while loops
  • Write reusable functions with parameters, return values, and default arguments
  • Pull in extra power with import and Python's standard library
  • Read and write files, and handle errors gracefully with try/except
  • Write Pythonic code with comprehensions, slicing, enumerate, and zip
  • Install packages with pip, write a simple class, and work with JSON

Syllabus