The conversion could fail if it isn't an integer. So we can catch the error: import sys ... try: n = int(nstr.rstrip()) ...
確定! 回上一頁