2019年11月20日 星期三

while

reference from 圖解 python 程式設計入門


ans=input("請輸入數字")
while not ans.isdigit():
    print("不是數字,請輸入數字")
    ans=input()
print("你輸入的數字是{}".format(ans))

沒有留言:

張貼留言