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 · בסיסי Python · Counting loops · ספירות במחזוריות →
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.
עברית
סכם מספרים מאחד לחמש
השתמש בלולאת for כדי להוסיף 1 + 2 + 3 + 4 + 5 לתוך total.
range(1, 6) נותן ל-1 את הערך מ-5: הוא מתחיל במספר הראשון ונעצר לפני השני. הוסף כל אחד מהם לסכום שמתחיל ב-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. · לחץ על הרץ כדי לראות את התוצא כאן.