Subject: [Tutor] changing char list to int list isn't working
I'm turning an integer into a string so I can make a list of separate chars,
then turn those chars back into individual ints, but the resulting list still
looks like string chars when I print it. What am I doing wrong?
listOfNumChars
On 04/05/13 05:13, Jim Mooney wrote:
I'm turning an integer into a string so I can make a list of separate
chars, then turn those chars back into individual ints,
You don't actually need to convert to chars, you could
use divmod to do it directly on the numbers:
digits = []
root = 455
On 05/04/2013 12:13 AM, Jim Mooney wrote:
for num in listOfNumChars:
num = int(num)
It seems like people learning Python run into this very often.
I think the reason is that in most simple cases, it's easier and more
intuitive to think that the name IS the object:
x = 1
y = 2
print x +
I'm turning an integer into a string so I can make a list of separate
chars, then turn those chars back into individual ints, but the
resulting list still looks like string chars when I print it. What am
I doing wrong?
listOfNumChars = list(str(intNum))
for num in listOfNumChars:
num =
On Sat, May 4, 2013 at 12:13 AM, Jim Mooney cybervigila...@gmail.com wrote:
I'm turning an integer into a string so I can make a list of separate
chars, then turn those chars back into individual ints, but the
resulting list still looks like string chars when I print it. What am
I doing wrong?
On 04/05/13 14:13, Jim Mooney wrote:
I'm turning an integer into a string so I can make a list of separate
chars, then turn those chars back into individual ints, but the
resulting list still looks like string chars when I print it. What am
I doing wrong?
listOfNumChars = list(str(intNum))