4 ms·
I rarely use str() and int() unless I'm doing conversion of user input (e.g. web apps). You'd have to be more specific about your usage. For instance, string f
by mcav 18y ago
I rarely use str() and int() unless I'm doing conversion of user input (e.g. web apps). You'd have to be more specific about your usage.
For instance, string formatting doesn't require casts -- just pretend everything's a string:
>>> print "%s %s %s = %s" % (4, '-', 1, 3)
4 - 1 = 3
- makecheck 18y agoTrue, unless the format is inherently numerical; e.g. if you care about significant digits (something like "%.4f") or padding (something like "%4d"), there's no way to do it without an actual number.