Skip to content · ⁨본문 바로가기⁩

Running total · ⁨누적 합계⁩

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은 루프 안에 속해야 합니다.

Log in or create account · ⁨로그인 또는 계정 만들기⁩

IGCSE, A-Level & AP