mac8090 ha scritto:
>
> for x in range(10):
>      for y in range(10):
>           if 2^x*3^y==12:
>                 break
>
> (x,y)
>
>   

I would like that :

def foo():
   for x in range(10):
      for y in range(10):
         if 2^x*3^y==12:
            return (x,y)


The return command exits the function (in particular the two loops).

Hope that it helps

Laurent


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to