> sage: L = []
> sage: for a in xrange(1, 2):
> ....:     for b in xrange(2, 3):
> ....:         L.append([a, b])
> ....:

Would srange or sxrange work here, and then obviate the need for
Integer below?  I can't remember what srange returns, but I think they
are not Python ints, at least.

- kcrisman

> sage: for item in L:
> ....:     print Integer(item[0]) / Integer(item[1])
> ....:
> 1/2
>
> }}}
>
> The for loops above generate Python integers, not Sage Integers.
> That's why you got zeros in your original Sage session.
>
> --
> Regards
> Minh Van Nguyen
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to