4 Respostas
+ 14
The str() function converts a non-string into a string e.g.
print(2 * 5) outputs 10
print(2 * str(5)) outputs 55
+ 15
str statement is "string"
String literals inside triple quotes, """" or ''', can span multiple lines of text. Python strings are "immutable" which means they cannot be changed after they are created (Java strings also use this immutable style).
A subtle but important behavior of str is that it works on None, the Python null value. It returns the string 'None'. You'll use this to your advantage in the info function, as you'll see shortly.
0
Thank You
0
'str' is used for typecast a value to String