0
Ok i know how to create string.
but what is the meaning of this str (12).
2 Answers
+ 4
what str(12) does is convert 12 from a integer to a string. so it will go from 12 to '12'
0
" ...Return a string version of object. If object is not provided, returns the empty string. Otherwise, the behavior of str() depends on whether encoding or errors is given, as follows... "
4.7. Text Sequence Type â str
ex:
x = str(42343)
y = str()
z = str(13)
print(x,y,z)
print(x+y+z)
result:
>>
42343 13
4234313
https://docs.python.org/3/library/stdtypes.html#str