#loop_ex.py

#for : for ... in(객체)

for i in range (1, 10, 2):
    print(i, end =",")
else: # 루프가 종료없이 끝났을때
    print()

#시퀸스 객체를 이용한 for 문
animals = ['dog', 'cat', 'cow', 'tiger']
for animal in animals:
    print(animal, end=",")
else:
    print()
    
# enumerate를 이용한 루프
for index, value in enumerate(animals):
    print(index, value)

# while문

sum, i =0, 1

while i <= 1000:
    sum += i
    i += 1

print("합계는:", sum)

7911c2491940a1af65af477a7a7de0c018016a0a
<mask token>

for i in range(1, 10, 2):
    print(i, end=',')
else:
    print()
<mask token>
for animal in animals:
    print(animal, end=',')
else:
    print()
for index, value in enumerate(animals):
    print(index, value)
<mask token>
while i <= 1000:
    sum += i
    i += 1
print('합계는:', sum)

for i in range(1, 10, 2):
    print(i, end=',')
else:
    print()
animals = ['dog', 'cat', 'cow', 'tiger']
for animal in animals:
    print(animal, end=',')
else:
    print()
for index, value in enumerate(animals):
    print(index, value)
sum, i = 0, 1
while i <= 1000:
    sum += i
    i += 1
print('합계는:', sum)

#loop_ex.py

#for : for ... in(객체)

for i in range (1, 10, 2):
    print(i, end =",")
else: # 루프가 종료없이 끝났을때
    print()

#시퀸스 객체를 이용한 for 문
animals = ['dog', 'cat', 'cow', 'tiger']
for animal in animals:
    print(animal, end=",")
else:
    print()
    
# enumerate를 이용한 루프
for index, value in enumerate(animals):
    print(index, value)

# while문

sum, i =0, 1

while i <= 1000:
    sum += i
    i += 1

print("합계는:", sum)
