Easy Tutorial
❮ Python Get Yesterday Python Func Number Hypot ❯

Python str() Function

Python Built-in Functions


Description

The str() function converts an object into a human-readable format.

Syntax

Here is the syntax for the str() method:

class str(object='')

Parameters

Return Value

Returns a string format of the object.


Examples

The following examples demonstrate the use of the str() method:

>>> s = 'tutorialpro'
>>> str(s)
'tutorialpro'
>>> dict = {'tutorialpro': 'tutorialpro.org', 'google': 'google.com'}
>>> str(dict)
"{'google': 'google.com', 'tutorialpro': 'tutorialpro.org'}"
>>>

Python Built-in Functions

❮ Python Get Yesterday Python Func Number Hypot ❯