MicrolearnENPTES

Learn Python: 20 free interactive lessons

Short lessons with real Python 3 running in your browser. Every example runs, every variable can be watched step by step, and you can change any line and run it again.

Do it in the browser: a real Python tool, a short mission and instant feedback. No install. Optional certificate at the end of the course.

Open the course

Lessons

  1. Hello, printYour first program: tell Python to show something on the screen.
  2. VariablesGive a name to a value and use it again later.
  3. Numbers and textint, float and str: what each type can do and how to convert between them.
  4. Reading inputinput() pauses the program and returns what the user typed, always as text.
  5. True or FalseComparisons produce booleans, the raw material of every decision.
  6. if and elseRun a block only when a condition is true, otherwise run another.
  7. Many cases with elifCheck conditions in order and stop at the first true one.
  8. and, or, notA loan is approved only with enough income and no debts. One false part makes the whole and false.
  9. for and rangeRepeat a block once for each value in a sequence.
  10. while loopsRepeat while a condition stays true, for when you do not know how many times.
  11. AccumulatingSum, count and find the best value while you loop.
  12. break and continueLeave a loop early or skip to the next round.
  13. ListsAn ordered collection you can index, change and grow.
  14. SlicesTake a piece of a list or string with [start:stop:step].
  15. DictionariesStore values under keys: look up by name instead of position.
  16. ComprehensionsBuild a new list from another in one readable line.
  17. FunctionsPackage code under a name, give it inputs and get a result back.
  18. Handling errorstry/except lets a program react to problems instead of crashing.
  19. Classes and objectsBundle data and the functions that act on it into your own type.
  20. Project: word counterCombine strings, loops, dictionaries and functions in a real little tool.