str

Full name
str
Library
Built-in
Syntax

class str(object = '')

Description

The str function returns the text version of the object included as an argument. If no argument is included, the function returns an empty text string.

Parameters
  • object: (Optional) object to convert to text string.
Examples

In this example, the function returns the text version of a complex number:

n = str(1-2j)
print(n)
print(type(n))

Str function. Example of use

 

Submitted by admin on Sun, 01/20/2019 - 17:39