Chapters
Python114 chapters

ReferenceBuilt-in functions

str()

The readable text form of an object, from its __str__.

Signature

str(object='')

Parameters

NameMeans
objectanything

Returns

A string.

Example

Python
print(str(42) + " bottles")
print(str(3.0))
print(str([1, 2]))

Output

42 bottles
3.0
[1, 2]

See also