Running total · المجموع المتسلسل
Running total
Add up the list [5, 10, 20] one number at a time, printing the total after each step: 5, 15, 35.
Lines indented under the for run every time round the loop; a line after the loop runs only once. Here the print belongs inside the loop.
المجموع التراكمي
اجمع قائمة [5, 10, 20] رقمًا تلو الآخر، وطبع المجموع بعد كل خطوة: 5، 15، 35.
الأسطر المسطحة تحت for تُنفذ في كل دورة للحلقة؛ السطر بعد الحلقة يُنفذ مرة واحدة فقط. هنا ينتمي print داخل الحلقة.
Loop over nums and keep a total. After adding each number, print the total so far: 5, then 15, then 35. · مرر على nums وأبقِ مجموعًا تراكميًا. بعد إضافة كل رقم، اطبع المجموع حتى الآن: 5، ثم 15، ثم 35.
Click Run to see the output here. · اضغط تشغيل لرؤية المخرجات هنا.