Learn Python 3
Start from zero and write real Python 3 programs: text and numbers, decisions, lists and loops, functions, strings, modules, dictionaries, files and your own classes.
- Beginner level
- 11 modules
- 84 lessons
- 299 tasks and questions
Syllabus
01Hello, PythonWrite and run your first programs: print text, leave comments, store values in variables, read error messages and do math.9 lessons
02Text, types and inputJoin strings, convert between numbers and text, fill in messages with f-strings and read input, then put it together in a budget calculator.6 lessons
03Making decisionsCompare values, branch with if, elif and else, combine conditions with and, or and not, and pick between options with match.7 lessons
04ListsStore many values in one list: create lists, read items by index, add and remove items, slice, sort and summarize, nest lists, and meet tuples and zip().8 lessons
05LoopsRepeat work with for and while loops, count with range(), steer loops with break and continue, nest loops, and build lists with comprehensions.8 lessons
06FunctionsPackage code into reusable functions: parameters and arguments, return values, defaults and keyword arguments, scope, and passing functions around with lambda, map() and filter().8 lessons
07Working with stringsTreat text as a sequence: index and slice it, escape special characters, loop over it, change case, split and join, clean and search, and format output precisely.9 lessons
08ModulesUse Python's standard library: import modules, pick names with from and as, generate random values, work with dates and times, and organize your own code into modules.6 lessons
09DictionariesStore and look up data by key: create dictionaries, read values safely, add and remove pairs, loop over them, and build them from other data.7 lessons
10FilesRead and write text files, process them line by line, and work with the two most common data formats: CSV and JSON.8 lessons
11Classes and objectsCreate your own types: define classes, give them methods and constructors, tell class and instance attributes apart, control how objects print, and combine classes in a project.8 lessons