|
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| |
You can
convert anything to a string
|
|
|
>>> str(42), str(3.8), str([1,2,3])
|
|
|
42, 3.8, [1, 2, 3]
|
|
|
>>> str(len)
|
|
|
<built-in function len>
|
|
|
>>> str(str)
|
|
|
<type str>
|
|
|
| |
Converting
a string to something else is pretty straightforward
|
|
>>> int(42), float(42), list(42)
|
|
|
42, 42.0, [4, 2]
|
|
|
|