close

一個 while 迴圈,使用 Input來控制停止

====================================

import time

stop = 1

while(stop != 0) :                # stop = 0 迴圈會停止
   
    time.sleep(0.5)
    stop = int(input("input:"))   #
  
    if stop == 0:
        pass
    else:
        print("Go on")

print("End")

====================================

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 ricky10116r2d2 的頭像
    ricky10116r2d2

    ricky10116r2d2的部落格

    ricky10116r2d2 發表在 痞客邦 留言(0) 人氣()