Add up one to five · Additionner de un à cinq
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version. · Cette page nécessite un navigateur récent (avec support SharedArrayBuffer). Veuillez mettre à jour Chrome, Edge, Firefox ou Safari vers la dernière version.
This one builds on a lesson you haven't finished yet. Do that lesson first: · Celui-ci repose sur une leçon que vous n'avez pas encore terminée. Terminez d'abord cette leçon :
Python Basics · Bases Python · Counting loops · Boucles de comptage →
English
Add up one to five
Use a for loop to add 1 + 2 + 3 + 4 + 5 into total.
range(1, 6) gives 1 to 5: it starts at the first number and stops before the second. Add each one onto a total that starts at 0.
Français
Additionner de un à cinq
Utilisez une boucle for pour additionner 1 + 2 + 3 + 4 + 5 dans total.
range(1, 6) donne 1 jusqu'à 5 : il commence au premier nombre et s'arrête avant le second. Ajoutez chacun à un total qui commence à 0.
Use a for loop to add 1 + 2 + 3 + 4 + 5 into total. · Utilisez une boucle for pour additionner 1 + 2 + 3 + 4 + 5 dans total.
Click Run to see the output here. · Cliquez sur Exécuter pour voir le résultat ici.