Next / Previous / Contents / TCC Help System / NM Tech homepage

20.40. str(): Convert to str type

To convert any value x to a string, use this general form:

str(x)

For example:

>>> str(17)
'17'
>>> str({'boy': 'Relmond', 'girl': 'Wirdley'})
"{'boy': 'Relmond', 'girl': 'Wirdley'}"

For general information, see Section 9, “Type str: Strings of 8-bit characters”.