2. 제어문 2017-09-29 Python If문 PythonExam.pi123456789101112131415161718192021222324252627a = 10if a > 5: print("big")else: print("small")n = -2if n > 0: print('양수')elif n < 0: print('음수')else: print('0')order = 'spam'if order == 'spam': price = 1000elif order == 'egg': price = 500elif order == 'spagetti': price = 2000else: price = 0print(price) For문 PythonExam.pi123456789a = ['cat', 'cow', 'tiger']for animal in a: print(animal)for x in range(10): print(x, end=" ") while문 PythonExam.pi123456count = 1while count < 11: print(count, end=' ') count += 1else: print('') break, continue, else PythonExam.pi123456789101112131415161718192021i = 0while i < 10: i += 1 if i < 5: continue print(i, end=' ') if i > 10: breakelse: print('else block')print('done')i = 0while True: print(i) if i > 5: break i += 1