另外如果想要把例外狀況印出來可以設為一個變數使用:. def str_to_int(text): try: return int(text) except ValueError as e: print(e) return None.
確定! 回上一頁