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 [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
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---