Skip to content · ⁨דלג לתוכן⁩

Sum a list · ⁨סכום רשימה⁩

English

Sum a list

Add up every number in a list and return the total. Start a running total at 0, then loop over the list and add each value to it.

This pattern — a running total that grows inside a loop — comes up everywhere in programming.

עברית

סכום רשימה

סכום כל מספר ברשימה והחזר את הסך הכולל. התחל סכום נמשך ב-0, ולאחר מכן עבור על הרשימה והוסף כל ערך אליה.

דפוס זה — סכום נמשך שגדל בתוך לולאה — מופיע בכל מקום בתכנות.

Log in or create account · ⁨היכנס או צור חשבון⁩

IGCSE, A-Level & AP