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
The Definitive Guide to HTML5 WebSocket
Vanessa Wang、Frank Salim、Peter Moskovits / Apress / 2013-3 / USD 26.30
The browser is, hands down, the most popular and ubiquitous deployment platform available to us today: virtually every computer, smartphone, tablet, and just about every other form factor imaginable c......一起来看看 《The Definitive Guide to HTML5 WebSocket》 这本书的介绍吧!