Name | str() |
||
---|---|---|---|
Examples |
b = False y = -28 c = 'R' f = -32.6 i = 1024 sb = str(b) sy = str(y) sc = str(c) sf = str(f) si = str(i) sb = sb + sy + sc + sf + si print(sb) # Prints 'False-28R-32.61024' | ||
Description | Returns the string representation of primitive datatypes and arrays. For example the integer 3 will return the string "3", the float -12.6 will return the string "-12.6", and a Boolean value True will return the string "True". | ||
Syntax | str(var) | ||
Parameters |
| ||
Related |
string String Formatting .find() .strip() .join() .replace() |
Updated on Tue Feb 27 14:07:12 2024.
If you see any errors or have comments, please let us know.
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License