Python入門的36個例子 之 35 -> try – 一個使用的例子

源代碼下載:下載地址在這裏

 

 

output:

 

Input a number:w
That is not a valid number. invalid literal for int() with base 10: 'w'
Input a number:9
Input a number:0
Divisor is zero: integer division or modulo by zero
Input a number:9
Input a number:3
There is no error.
9 / 3 = 3

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章