OneCompiler

Python

Learn Python from scratch on a real Python 3.12 runtime. Short lessons from your first print to classes, dictionaries, comprehensions, exceptions, files and libraries, each ending in an exercise you solve right in the editor.

13 sections·59 items·Beginner
This course includes
  • 60 practice problems
  • 59 lessons
  • Free — runs in your browser, no setup

What you'll learn

Write and run complete Python programs
Use variables, numbers, strings, f-strings and console input
Direct programs with if/elif/else, loops, break, continue and match
Write functions with default arguments, lambdas and recursion
Master lists, tuples, slicing and reference semantics
Look up and count with dictionaries, deduplicate with sets
Transform data with comprehensions and key-based sorting
Design classes with methods, inheritance and dataclasses
Read tracebacks and handle failures with try/except and raise
Use the standard library, files, and third-party packages

Syllabus

About this course

People use Python to automate tasks, build web applications, work with data, and write everyday scripts. You need very little setup to start, so it is a good first programming language.

You do not need any programming experience to take this course. Every program runs on Python 3.12. The first sections teach output and variables, and then conditions. Later sections cover functions, collections, classes, exceptions, files, and third-party packages.

Each lesson ends with an exercise that you solve in the editor. After you learn how to read input, many exercises test your code with several different inputs. So your program has to work for more than the one example you see.

By the end, you will be able to build a small command-line project and set up a virtual environment. You will also know how to choose the libraries you need for your next goal.