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

#range(a, b) : 연속된 숫자로 이루어진 시퀀스를 자동으로 만들어주는 함수
#a:시작 인덱스 b:종료 인덱스(미만)

for i in range(5):
    print('안녕')

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

print('----구구단----')
for i in range(5,10): #5단부터 9단까지
    for j in range(1, 10): 
        print(i ,'x', j, '=', i*j)

print('----문제1----')
for i in range(1,6):
    print('*' * i)

print('----문제2----')
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: