看板 Python 關於我們 聯絡資訊
tiefblau: raw_input吃進來是string 03/01 23:36
tiefblau: 轉型:加個b = int(b) 或是 用input()吃進來 推薦第一個 03/01 23:42
tiefblau: 因為python3就沒raw_input了 還可避免人家輸入奇怪東西 03/01 23:43
補充一下: .. code:: Python >>> '1' > 1 # in Python2.x True >>> '1' > 1 # in Python3.x Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: unorderable types: str() > int() 用 Python3 至少你可以更快發現錯誤, 而不會像 Python2 不直覺的就跑過去了 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 15.211.131.254 ※ 文章網址: https://www.ptt.cc/bbs/Python/M.1425527985.A.625.html
Dong0129: 謝謝你,目前還正在摸索、研究,版友幫助我很多,感激 03/05 15:47
Dong0129: 不盡 03/05 15:47
tiefblau: 推推... 雖然我都在用py2 XDD 03/05 21:24
RishYang: Python 2.7再戰十年 03/20 06:40