
#리스트 method
colors = ['red', 'blue', 'white', 'black', 'purple']
colors.pop(1) #값 반환
colors.remove('black') #값 삭제
colors
>['red', 'white', 'purple']


bag = ['핸드폰', '책']
if '돈' in bag:
print("택시타기")
else:
print("걸어가기")
>걸어가기

#while
i = 1
while i <= 30:
print(i)
i += 1
> 1
2
..
30
#for
for i in range(1, 31): #1부터 30
print(i)
for i in range(30): #0부터 29
print(i+1) #1씩 더해서
> 1
2
..
30



#반복문 활용

#코드 간결화
...
for i in range(5):
numbers.append(int(input()))

#무한 루프
while True: #조건식이 항상 참이므로 변화식 필요 X
..
break #반복문 빠져나옴
