On Mon, Apr 5, 2010 at 12:14 PM, Dana Ernst <[email protected]> wrote:
> I think I understand how to deal with "for" statements in Sage. For
> example:
>
> for j in range(5):
> print 3^j
>
> will output the values of 3^0, 3^1, ..., 3^5. However, how could I do this
> for all the numbers, say 1 to 100, instead of just 3? Maybe this is a silly
> example, but I'm wondering how to deal with a double-index.
You can do it like this:
for i in range(5):
for j in range(5):
print i^j
--Mike
--
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
To unsubscribe, reply using "remove me" as the subject.