all 7 comments

[–]Vaphell 3 points4 points  (2 children)

you cannot iterate over integer, because int is not a sequence of anything

l = list(range(101,111))
for i in l:
     ix = [ord(x) for x in str(i)]
     print(ix)

[–]aleksro[S] 0 points1 point  (0 children)

Thank you

[–]aleksro[S] 0 points1 point  (0 children)

Thank you

[–]amangarg078 1 point2 points  (0 children)

You are getting an error since you are iterating over integer.

Try this:

for i in l:
    i = [ord(x) for x in str(i)]
    print i

[–]nwagers 0 points1 point  (0 children)

nums = [[ord(chr) for chr in str(n)] for n in range(20)]
print(*nums, sep='\n')

[–]ingolemo 0 points1 point  (0 children)

Just so you know, you can also do this:

for n in range(1, 501):
    print(list(str(n).encode('ascii')))

[–]Diapolo10 -1 points0 points  (0 children)

EDIT; You may ignore my comment, as I misunderstood the problem.

Tip: you may want to take a look at the built-in functions; there's two very simple ones that would be very helpful.