모든 루프는 특정 횟수 또는 특정 조건이 충족될 때까지 실행되도록 구성됩니다. 그러나 조건이 발생하지 않으면 루프가 계속 무한반복됩니다. 이러한 무한 루프는 키보드 인터럽트를 생성하여 강제로 중지해야 합니다. Ctrl-C를 누르면 무한 루프 실행이 중지됩니다.
>>> while True: print ('hello') hello hello hello hello hello hello Traceback (most recent call last): File "<pyshell#18>", line 2, in <module> print ('hello') KeyboardInterrupt