Add up one to five · 1から5までの合計
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version. · このページには最新のブラウザ(SharedArrayBuffer対応)が必要です。Chrome、Edge、Firefox、Safariを最新バージョンに更新してください。
This one builds on a lesson you haven't finished yet. Do that lesson first: · これはまだ完了していないレッスンの先にある内容です。まずはそのレッスンを済ませてください:
Python Basics · Counting loops · カウントループ →
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.
Use a for loop to add 1 + 2 + 3 + 4 + 5 into total. · forループを使って、1 + 2 + 3 + 4 + 5をtotalに加算します。
Click Run to see the output here. · 実行ボタンをクリックして出力を確認してください。