看板
[ Python ]
討論串判斷raw_input輸出資料範圍的問題
共 3 篇文章
首頁
上一頁
1
下一頁
尾頁
內容預覽:
感謝您. 我後來改成以下的方式:. def get_input():. try:. data = int(raw_input()). except ValueError:. print "Wrong input, input again!!". get_input(). else:. global
(還有365個字)
內容預覽:
try:. : guessed_num = int(raw_input());. except ValueError:. print "Maybe some error, Please Input a number between 1 and 10.". return. 用例外(exception)
(還有93個字)
內容預覽:
大家好,我是個python初學者. 想請教各位強者我的練習程式中的問題. 程式碼如下:. import random. def guess_num():. rand_num = int(10*random.random()) + 1. end_flag = False. while end_flag
(還有244個字)
首頁
上一頁
1
下一頁
尾頁