Passer au contenu
Apprendre à coder — Python, Java, C, SQL & Web

Bases Python

Vos tout premiers pas en programmation — aucune expérience requise.

  • python
  • 22 Leçons
  • 6 projects
  • 15 videos
  • S'exécute dans votre navigateur

Sur cet appareil : 0 sur 22 leçons terminées

Commencer le cours

Chaque leçon s'exécute dans votre navigateur — écrivez du vrai code, appuyez sur Exécuter, et les tâches se vérifient automatiquement. Gratuit, pas de compte requis, avec des notes traduites associées à l'anglais.

Leçons dans ce cours

26 sur 26 leçons affichées

Part 1 You build: Project: Mad Libs

  1. Exécutez-le ! Les boutons · Quand quelque chose tourne mal · Quand un programme attend de vous Lesson 0 · 3 tâches requises · ★
  2. Votre premier programme Show text with print · Strings · Comments Lesson 1 · 3 tâches requises · ★ Vidéo
  3. Variables A box with a name · Make a variable · Naming rules · Change a variable Lesson 2 · 3 tâches requises · ★ Vidéo
  4. Nombres & opérateurs Two kinds of number · Add, subtract, multiply, divide · Whole-number division, remainder, powers · Order of operations Lesson 3 · 3 tâches requises · ★ Vidéo
  5. Obtenir une entrée Ask the user with input · When your program waits · input always gives a string · Turn text into a number Lesson 4 · 3 tâches requises · ★ Vidéo
  6. Travailler avec des chaînes Letters have positions · Take a slice · Length and changing case · f-strings build text Lesson 5 · 4 tâches requises · ★★ Vidéo
  7. Projet Project: Mad Libs Collect the words · Change a word · A title with a line under it Projet · ★★

Part 2 You build: Project: Guess the number

  1. Prendre des décisions Making a choice · Comparisons · if / elif / else · The remainder Lesson 6 · 4 tâches requises · ★★ Vidéo
  2. Boucles de comptage Repeat with for · Counting with range · Build a total (accumulator) · Words and a number on one line Lesson 7 · 4 tâches requises · ★★ Vidéo
  3. Boucles While Loop while a condition is true · Always change the condition · break and continue · Checking before or after Lesson 8 · 3 tâches requises · ★★ Vidéo
  4. Projet Project: Guess the number One guess · Keep guessing · Print the count · The sentence Projet · ★★★

Part 3 You build: Project: Quiz with a score

  1. Lists (1-D arrays) A list holds many values · Get and change items · Add items and count them · Loop over a list Lesson 9 · 3 tâches requises · ★★ Vidéo
  2. Projet Project: Quiz with a score Two lists that match · Keep the score · Forgive the typing Projet · ★★★

Part 4 You build: Project: Rock, paper, scissors

  1. Fonctions Name a block of code · Give it inputs (parameters) · Send back a result (return) · return vs print Lesson 10 · 3 tâches requises · ★★ Vidéo
  2. Projet Project: Rock, paper, scissors Who wins? · Functions can use functions · Check what the player typed · Play for real Projet · ★★★

Part 5 You build: Project: Text adventure

  1. Portée & arguments Local variables · Global variables · Default values · How arguments are passed Lesson 11 · 4 tâches requises · ★★★ Vidéo
  2. Dictionaries (records) Store data by name · Get and set values · A dictionary as a record · Check and loop Lesson 12 · 3 tâches requises · ★★★ Vidéo
  3. Projet Project: Text adventure A dictionary inside a dictionary · Is there a door? · Follow a list of directions · Play for real Projet · ★★★★

Part 6 You build: Project: Hangman

  1. Planification & pseudocode Plan before you code · Decomposition · Abstraction · Structured English Lesson 13 · 3 tâches requises · ★★ Vidéo
  2. Erreurs & tests Three kinds of error · Syntax errors · Runtime errors · Logic errors Lesson 14 · 3 tâches requises · ★★★ Vidéo
  3. Tout mettre ensemble The plan · Handy built-ins for lists · A pattern you will reuse: count items that pass a test Lesson 15 · 3 tâches requises · ★★★ Vidéo
  4. Projet Project: Hangman Plan first · Build a string letter by letter · Stop as soon as you know · The game loop Projet · ★★★★

Lecture et ressources

  1. Une courte histoire de Python Where Python came from · Why the funny name · Built for people to read · Python today Lecture et ressources
  2. Ce dont Python est utilisé What people build with Python · Websites and apps · Data, AI, and science · Automation Lecture et ressources
  3. Où apprendre davantage Jouer et pratiquer · Lire et consulter · Plus de cours sur ce site · Astuce Lecture et ressources
  4. Configurez votre ordinateur Run Python on your own computer · Step 1 — Install Python · Step 2 — Install VS Code · Step 3 — Add the Python extension Lecture et ressources
Open the Python reference Every topic in one place, with short examples you can run.

Où apprendre davantage

Se connecter ou créer un compte

IGCSE, A-Level & AP