看板 [ Python ]
討論串[問題] 負數如何進迴圈判斷?
共 2 篇文章
首頁
上一頁
1
下一頁
尾頁

推噓5(5推 0噓 3→)留言8則,0人參與, 5年前最新作者shentotto (無名火)時間5年前 (2019/02/12 18:15), 編輯資訊
1
1
0
內容預覽:
各位高手好小弟菜雞在練習習題時碰壁了. 書裡的題目是這樣:. 當你輸入正數時輸出負數,輸入負數時轉成正數,如果你輸入非數字時輸出"必須為數字". http://i.imgur.com/lLGL13w.jpg. 圖片. ss = input("請輸入數字"). if ss.isdigit():. if
(還有183個字)

推噓6(6推 0噓 3→)留言9則,0人參與, 5年前最新作者yeuan (心要夠堅定)時間5年前 (2019/02/14 08:47), 編輯資訊
0
1
0
內容預覽:
s = input("Enter a number: "). try:. print(float(s) * -1). except:. print("Your input should be a number."). --. 發信站: 批踢踢實業坊(ptt.cc), 來自: 67.249.65.
首頁
上一頁
1
下一頁
尾頁