Python3---内置函数---str(),,前言该文章描述了函数
Python3---内置函数---str(),,前言该文章描述了函数
前言
该文章描述了函数str()的使用
2020-01-15
天象独行
0X01;描述
str() 函数将对象转化为适于人阅读的形式。
0X02;语法
class str(object=‘‘)
参数:
object 表示对象
0X03;返回值
返回一个对象的string格式
0X04;举例:
#!/uer/bin/env python#coding:utf-8a = ‘i am a teather‘dict = {‘1‘:‘b‘,‘2‘:‘c‘}print(str(a))print(str(dict))
运行结果
/home/aaron/桌面/Python3-Test/venv/bin/python /home/aaron/桌面/Python3-Test/20200115.pyi am a teather{‘1‘: ‘b‘, ‘2‘: ‘c‘}Process finished with exit code 0
Python3---内置函数---str()
评论关闭