首页 > 技术文章 > python类型转换 int, str, list, long, tuple

littlefire 2013-10-25 00:55 原文

1 int(x [, base ])           #转换整数
2 long(x [, base])           #转换成长整数  
3 str(x)                     #转换成字符串  
4 repr(x)                    #转换成表达式字符串  
5 tuple(x)                   #转换成元组  
6 list(x)                    #转换成列表  
7 chr(x)                     #转换成字符       

to be continued...

推荐阅读