On Jan 17, 2009, at 9:00 AM, A. Jorge Garcia wrote:
> I'm really liking this Sage environment. So, I suppose its time to
> learn some python. I tried the following code:
>
> for p in range(2,10)
> if is_prime(2^p-1)
> print p, 2^p-1
>
> and got the error:
>
> Syntax Error:
> if is_prime(2^p-1)
>
> what am I missing?
You are missing a colon:
for p in range(2,10):
You also need a colon:
if is_prime(2^p-1):
Enjoy your learning experience!
Jim Clark
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-edu" group.
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-edu?hl=en
-~----------~----~----~----~------~----~------~--~---