Python str() 函数
Python 3 教程
· 2019-02-05 08:56:26
描述
str() 函数将对象转化为适于人阅读的形式。
语法
以下是 str() 方法的语法:
class str(object='')
参数
- object -- 对象。
返回值
返回一个对象的string格式。
实例
以下展示了使用 str() 方法的实例:
>>>s = 'CODERCTO'
>>> str(s)
'CODERCTO'
>>> dict = {'codercto': 'codercto.com', 'google': 'google.com'};
>>> str(dict)
"{'google': 'google.com', 'codercto': 'codercto.com'}"
>>>
点击查看所有 Python 3 教程 文章: https://codercto.com/courses/l/10.html
Web Development Recipes
Brian P. Hogan、Chris Warren、Mike Weber、Chris Johnson、Aaron Godin / Pragmatic Bookshelf / 2012-1-22 / USD 35.00
You'll see a full spectrum of cutting-edge web development techniques, from UI and eye candy recipes to solutions for data analysis, testing, and web hosting. Make buttons and content stand out with s......一起来看看 《Web Development Recipes》 这本书的介绍吧!