Run it! · Exécutez-le !
Start here
- A lesson is a list of short steps. Press Continue (the arrow at the bottom) for the next one.
- After the steps come tasks: code you change and run.
- Today you type very little. You change one small thing at a time.
Commencer ici
- Une leçon est une liste de courts étapes. Appuyez sur Continuer (la flèche en bas) pour la suivante.
- Après les étapes viennent les tâches : du code que vous modifiez et exécutez.
- Aujourd'hui, vous tapez très peu. Vous changez une petite chose à la fois.
The buttons
- Run ▶ runs the code. What it prints appears in the dark box under it.
- Check answer tests your code. Green means correct, and you win coins.
- The lightbulb gives a hint when you are stuck.
- Reset brings the starting code back.
Les boutons
- Exécuter ▶ lance le code. Ce qu'il imprime apparaît dans la boîte sombre en dessous.
- Vérifier la réponse teste votre code. Vert signifie correct, et vous gagnez des pièces.
- L'ampoule donne un indice lorsque vous êtes bloqué.
- Réinitialiser ramène le code de départ.
print("I am an example. Press the play button to run me.")
When something goes wrong
- If the code has a mistake, Python stops and shows red text.
- Under the red text, a card explains the error in English and Chinese and tells you which line to look at.
- Mistakes are normal. Read the card, fix one thing, and run again.
Quand quelque chose tourne mal
- Si le code a une erreur, Python s'arrête et affiche du texte rouge.
- Sous le texte rouge, une carte explique l'erreur en anglais et en chinois et vous dit quelle ligne examiner.
- Les erreurs sont normales. Lisez la carte, corrigez une chose, et relancez.
When a program waits for you
- Some programs ask a question with
input(). - Then a highlighted box appears: type here, then press Enter.
- Click the box, type your answer and press Enter. The program continues.
Quand un programme attend de vous
- Certains programmes posent une question avec
input(). - Ensuite une boîte soulignée apparaît : tapez ici, puis appuyez sur Entrée.
- Cliquez sur la boîte, tapez votre réponse et appuyez sur Entrée. Le programme continue.
name = input("What is your name? ")
print("Nice to meet you, " + name)
Now you try
- Three small tasks. Change the code, press Run, then Check answer.
À vous maintenant
- Trois petites tâches. Changez le code, appuyez sur Exécuter, puis Vérifier la réponse.
This program is switched off: the # at the start makes the line a comment, so Python skips it. Delete the #, press Run ▶ to see what it prints, then press Check answer. · Ce programme est désactivé : le # au début fait de la ligne un commentaire, donc Python le saute. Supprimez le #, appuyez sur Exécuter ▶ pour voir ce qu'il imprime, puis appuyez sur Vérifier la réponse.
Click Run to see the output here. · Cliquez sur Exécuter pour voir le résultat ici.
Change one word so the program prints I like dogs. Only the text inside the quotes changes. · Changez un seul mot pour que le programme affiche I like dogs. Seul le texte entre guillemets change.
Click Run to see the output here. · Cliquez sur Exécuter pour voir le résultat ici.
This program has a mistake. Press Run ▶ first and read the card under the red text: it explains the error. Then fix the line so the program prints Hello. · Ce programme contient une erreur. Appuyez d'abord sur Exécuter ▶ et lisez la carte sous le texte rouge : elle explique l'erreur. Puis corrigez la ligne pour que le programme affiche Hello.
Click Run to see the output here. · Cliquez sur Exécuter pour voir le résultat ici.