码迷,mamicode.com
首页 > 编程语言 > 详细

python 字符串 类型互相转换 str bytes 字符串连接

时间:2018-12-24 18:15:05      阅读:220      评论:0      收藏:0      [点我收藏+]

标签:pytho   类型   str   连接   bytes   pre   转换   print   str1   

直接看例子:

n = 888
print bytes(n)+str1
print str(n)+str1
print type(n)
n = bytes(n)
print type(n)
n = str(n)
print type(n)

查看结果

8881234567
8881234567
<type ‘int‘>
<type ‘str‘>
<type ‘str‘>

python 字符串 类型互相转换 str bytes 字符串连接

标签:pytho   类型   str   连接   bytes   pre   转换   print   str1   

原文地址:http://blog.51cto.com/weiruoyu/2334578

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!