本文介紹了將字符串轉(zhuǎn)換為 int 的簡短方法的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!
問題描述
我通常這樣做是為了將字符串轉(zhuǎn)換為 int:
I usually do this to convert string to int:
my_input = int(my_input)
但我想知道是否有不那么笨拙的方法,因?yàn)楦杏X有點(diǎn)長.
but I was wondering if there was a less clumsy way, because it feels kind of long.
推薦答案
my_input = int(my_input)
沒有比使用 int
功能(正如你提到的)
There is no shorter way than using the int
function (as you mention)
這篇關(guān)于將字符串轉(zhuǎn)換為 int 的簡短方法的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!
【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!