3
我在學習Python時使用Sublime Text 2
,實際上我只是一個初學者。現在,當我在編輯器中編寫type(1/2)
並構建它時(cmd + B),我得到的輸出爲int。相反,如果我在Sublime的終端(ctrl +`)中寫入相同的指令,我得到的結果爲float。有人可以解釋我爲什麼會這樣?Python類型()顯示不同的結果
type(1/2) #in Sublime's editor results: <type 'int'>
type(1/2) #in Sublime's python console results <type 'float'>
我相信它應該是 「INT」,但仍然爲什麼是說 「浮動」。
謝謝你,這是有道理的。 – Greenhorn
[如果這回答你的問題,請接受答案。](https://meta.stackexchange.com/questions/109956/is-it-important-to-say-thanks-after-getting-correct-answer) – AlexLordThorsen
我只是等着看,如果我能得到任何其他解釋這個問題的答案。任何如何,你回答我。 – Greenhorn