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

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python 字符串 类型互相转换 str bytes 字符串连接相关的知识,希望对你有一定的参考价值。

直接看例子:

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 字符串连接的主要内容,如果未能解决你的问题,请参考以下文章

python 集合互相转换

Python字符串元组列表字典互相转换的方法

Python字符串元组列表字典互相转换的方法

java 中 byte[]FileInputStream 互相转换

java 中 byte[]FileInputStream 互相转换

java 中 byte[]FileInputStream 互相转换