무한 루프 루프를 이용한 프로그램을 작성하기 전에 한 가지 더 생각해볼 문제가 있다. while
반복문의 루프-진행 조건이 언제나 만족되면 어떻게 될까? 지금까지 우리가 배운 문장들을 이용하면 나쁜 일 두 가지 중 하나가 생길 수 있는데, 이 둘 다 대처할 방법을 배워야 한다.
메시지를 출력하는 무한 루프
import stdio i = 4 while i > 3: stdio.write(i) stdio.writeln('th Hello') i += 1 % python3 infiniteloop1.py 1st Hello 2nd Hello 3rd Hello 5th Hello 6th Hello 7th Hello 8th Hello 9th Hello 10th Hello 11th Hello 12th Hello 13th Hello 14th Hello ...