【Python】 整型数与字符串相互转换

Python中字符串转换为数值:

str_num = '100'
num = int(str_num)


整型数转换为字符串:

num = 100
str_num = str(num)

posted @ 2018-05-25 19:42  SoaringLee_fighting  阅读(9024)  评论(0编辑  收藏  举报