'''
for 변수 in 반복할 대상:
    반복할 명령
'''
for i in [1, 2, 3]:
    print(i)

for a in 'abcd':
    print(a)

#range(시작, 종료)
for i in range(10):
    print(i)

#합을 구하는 프로그램
total = 0
for i in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]:
    total = total + i #total += i
    print(i, total)

total = 0
for i in range(11):
    total = total + i #total += i
    print(i, total)












Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: