Running total · 누적 합계
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 · Lists (1-D arrays) →
English
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. · 출력을 보려면 '실행'을 클릭하세요.