티스토리 뷰
/**
* Version :: Python 2.x , Python 3.x
* Desc :: python string to int, float, long
**/
Python 2.x , 3.x
# string to int
s = "123"
n = int(s)
# string to float
s = "123.456"
n = float(s)
# string to long
s = "1234567890123"
n = long(s)
/**
* 궁금한 점은 댓글로 남겨주세요.
* Please fell free to ask me any questions.
**/
'Python' 카테고리의 다른 글
[Python] 보글 게임 (BOGGLE) (1) | 2016.04.25 |
---|---|
[Python] URL Encoding & Decoding (429) | 2016.04.12 |
[Python] 16진수(Hex) < - > 문자열(String) 변환 (404) | 2016.04.11 |
[Python] 2진수, 8진수, 10진수, 16진수 변환 (423) | 2016.04.11 |
[Python] 위도, 경도 -> 기상청 X, Y 좌표 변환 (415) | 2016.02.01 |
댓글