If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Course overview

This course currently contains practice materials for units on variables, conditionals, loops, and functions. We're making continuous improvements, so stay tuned for new instructional materials and additional units!
In this course, you’ll use programming as a tool to design recommendation engines, simulate natural selection, invent game levels, and more. Through lessons designed with beginner programmers in mind, you'll learn how to read and write Python programs - no prior computer science experience required!

A practical approach

In designing this course, we focused on the skills you need to start building meaningful programs now. You'll see a focus on problem solving and program design over computer science theory.
We also heavily feature reading and working within existing code. There will be few cases where you'll see a blank screen and be asked to write a program from scratch. Programmers reference, reuse, and extend code in almost everything they do, so we think new programmers should, too!

What you'll learn

This course covers programming fundamentals in Python, including:
  • Data types, expressions, and variables
  • User input
  • Boolean logic and conditionals
  • Loops
  • Module imports and random numbers
  • Functions
Each unit introduces a new theme, like simulations or game design, so you can explore some of the many applications of programming along the way.

How you'll learn

This course includes three types of practice materials:
  • In Exercises, you'll practice reading programs.
  • In Challenges, you'll practice modifying programs.
  • In Projects, you'll design your own programs.

Exercises

Exercises are multiple choice problems that focus on tracing how a program executes and translating user requirements into code. When practicing a new skill, we recommend you start with the associated Exercise.

Challenges

Challenges are guided programming assignments in which you'll modify or extend an existing program. They provide step-by-step instructions and use automated evaluation tools to provide feedback along the way.

Projects

Projects are open-ended programming assignments that serve as the capstone for each unit. They provide a broad outline of a problem to solve and a rubric with a set of requirements, but the rest is up to you!

Frequently asked questions

Where are the videos and articles?

They're coming! We recognize that the Exercises, Challenges, and Projects may be challenging in the course's current state. That's because we haven't yet included any videos or articles to actually teach you how to do them - that's on us, not on you.
Adding instructional materials for the first four units is our top priority.

Will there be more units?

We're working hard to bring you more content that covers string manipulation, lists, 2D lists, dictionaries, and more. Stay tuned!

Is this course standards-aligned?

This course most closely matches the AP CS A learning objectives, but uses the Python programming language instead of Java. Due to the difference in languages, it is not recommended as a supplement for students in an AP CS A class, but rather as an alternative introductory computer science curriculum.

What version of Python does this course use?

Our programming platform uses Python 3.

Want to join the conversation?

  • marcimus red style avatar for user YokieBob
    Three questions:
    Will there ever be a graphics interface?
    Can we ever make our own programs from scratch? (will they get to the hotlist?)
    Will the course be added to the computer programming section?
    (30 votes)
    Default Khan Academy avatar avatar for user
    • winston default style avatar for user Kim M
      From the author:Yes, we will be adding support for creating programs from scratch in the near future. We're excited to see what you all will build! Stay tuned!

      This course will stay separate from the Computer Programming course, which focuses on JavaScript and graphics-based programming with the Processing library. This Python course will not use Processing.
      (16 votes)
  • blobby green style avatar for user ejloebner
    Can you give a timeline for when the course updates will be finished? A few weeks or a few months?
    (18 votes)
    Default Khan Academy avatar avatar for user
  • hopper cool style avatar for user Electric Dolphin ⚡️🐬
    Are there any plans to add a documentation?
    (13 votes)
    Default Khan Academy avatar avatar for user
  • starky sapling style avatar for user HAMBURGER RiDER
    Will our Python programs be released to the Hotlist?

    Kim M replied to YokieBob's question by saying we will be able to make programs by scratch, and was "Excited to see what we all will build."

    Does this mean our Python programs will reach the Hotlist?
    If not, will we be able to share our Python programs in some other way?
    (6 votes)
    Default Khan Academy avatar avatar for user
  • male robot hal style avatar for user Rock
    When will there be instructional materials available?
    (4 votes)
    Default Khan Academy avatar avatar for user
  • leafers sapling style avatar for user Nico S
    Hi. A few questions for the KA staff:

    1. Will there be a way in the future to create your own project, without provided instructions? If so, when?
    2. When do you plan on finishing this course?
    3. Do you expect to add more advanced concepts to this course, such as try/except statements and generator functions? When? If not, will they be in some other course?

    I would really like some answers, and I am sure many other students out there can say the same.
    (3 votes)
    Default Khan Academy avatar avatar for user
    • winston default style avatar for user Kim M
      From the author:Yes, we will be adding support for creating programs from scratch in the near future. We're excited to see what you all will build! Stay tuned!

      We don't have an exact date for you, but we're working on the next version of the course right now. We'll be sure to announce when the next update is released.

      We will be adding additional units to the course that cover more advanced concepts.
      (6 votes)
  • winston default style avatar for user Sarah G.
    does anyone have an idea of when this course might be finished?
    (3 votes)
    Default Khan Academy avatar avatar for user
  • boggle green style avatar for user HM Wogglebug TE
    This course has me very exited!

    The Wogglebug does have a few questions, though:

    Will future versions of the Python course use the ACE code editor that JS and HTML currently use?

    Are the changes in the course style here eventually going to migrate to the JS and HTML courses?

    Is there a Github repository for the editor?
    (4 votes)
    Default Khan Academy avatar avatar for user
  • piceratops ultimate style avatar for user Song Yang
    Three questions:
    Will there ever be a graphics interface?
    Can we ever make our own programs from scratch? (will they get to the hotlist?)
    Will the course be added to the computer programming section?
    (3 votes)
    Default Khan Academy avatar avatar for user
  • orange juice squid orange style avatar for user Mushy Avocado
    Will there be support for Pygame? It would be awesome to see programs created with it on the hotlist
    (3 votes)
    Default Khan Academy avatar avatar for user
    • leaf green style avatar for user KPPM Workflow Account
      I'm a bit late to give you a proper answer but here it is anyways.

      Pygame is an API for interacting with SDL windows on your computer. Even if we built an emulation layer between the browser and SDL, the overhead would make it almost unusable. At most, they could implement a library with a similar API. However, based on the current structure of how running the python is designed, I don't foresee graphics coming to python at any point soon.

      I've seen you around and know you know more than others asking questions here so I'll go more in depth:
      The python code is being run using a translation layer to compile python to wasm. The implications of this are that most python libraries probably will not work. However, if we did have a library that worked inside pyodide, it would probably still not be enough because pyodide is running inside a worker thread. Worker threads do not have access to the canvas. In order for python to access the canvas, on top of building an interface to design graphics, you would need the worker thread to send every color of every pixel every single frame (60 times a second). There is potential for massive overhead here, and as KA doesn't have a good track record of implementing things efficiently, I don't expect to see python be able to access the canvas any time soon.

      On the plus side, I do see two properties in the python scope, requestAnimationFrame and getCanvas2D/3D/set, which could indicate it is beign worked on.
      (2 votes)