Convert between python int and string

1. Conversion between int and string in Python
(1) string is converted to int
decimal string is converted to int
int('4')
(2) string is converted to int
hexadecimal string is converted to int
int('12', 16)

2. Convert int to string
(1) convert int to decimal string;
str(18)
(2) convert int to hexadecimal string;
hex(18)

Guess you like

Origin blog.csdn.net/tone1128/article/details/105531398