itoa on python?
hnowak at cuci.nl
Sun Nov 14 11:19:41 CET 1999
On 14 Nov 99, at 8:52, Gusdvg wrote:
> How can I change an integer (or any other type of number) to a string? In
> C I used itoa but I couldn't find it in the Python documentation.
Try one of these:
x = 42
print "%d" % x
The first two work with other types of numbers too. The third one is
like C's *printf, and is useful if you need formatting and such.
--Hans Nowak (zephyrfalcon at hvision.nl)
You call me a masterless man. You are wrong. I am my own master.
More information about the Python-list