'''
for문 기본형 - 시퀀스의 길이만큼 반복된다
for 변수 in 시퀀스:
    반복할 명령
'''
for i in [1, 2, 3]:
    print('*')

for i in 'abcd':
    print(i)

sum = 0
for i in [3, 6, 9]:
    sum = sum + i
    print(sum)

#range(a, b) : a부터 b미만까지의 자연수 시퀀스
#a:시작 , b:종료(미만)

for i in range(5,10):
    print(i)

count = 0
for i in range(1, 11):
    count = count + i
print(count)

print('----문제1----')
total = 0
for i in range(1,101):
    total = total + i
print(total)

Embed on website

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