iters on ints? (reducing the need for range/xrange)
Carsten Gaebler
clpy at snakefarm.org
Fri Nov 9 10:50:45 CET 2001
Greg Ewing wrote:
> It makes sense to think of files as containing lines,
> but it's stretching things to think of the integer 10
> somehow "containing" the integers 0 to 9.
Well, actually the integer 10
*does* contain the integers 0 to 9. This is one way of defining
integers mathematically.
Let 0 := {} (the empty set), then
1 := {0}
2 := {0, 1}
3 := {0, 1, 2}
'and so on ...' (which is deliberately un-mathematic :-)
So 'for i in 10:' would be okay because 10 is actually some sort of
sequence.
cg.
---
'In iteger arithetric divsion is no the oposite of multiplication.'
More information about the Python-list
mailing list