On Jan 17, 9:00 am, "A. Jorge Garcia" <[email protected]> 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?

colons at the end of the first and second lines:

 for p in range(2,10):
     if is_prime(2^p-1):
         print p, 2^p-1

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to