On Tue, Nov 20, 2012 at 10:48 AM, LFS <lfahlb...@gmail.com> wrote:
> How do you get sage out of a loop early?
> How do you get sage to totally stop in the middle of a block?
>
> for n in (0..2):
>   for m in (0..3):
>    p=2*m
>    print p
>    if p==2:
>      print 'I want out of loop'
>      m=4
>   if n==1:
>      print 'I want to stop Sage'
> print 'Did not stop Sage'

Define a function as use "return".


>
> I want to get out of m loop if p=2 and totally stop Sage if n=1.
> Thanks so much for any help.  Sorry if this is a dumb question. I looked and
> looked.
>
> BTW: Someone might want to add this good tutorial:
> http://modular.math.washington.edu/msri06/stein/tut.pdf to
> http://ask.sagemath.org/question/1086/where-is-basic-tutorial-for-sage
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> 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.
> Visit this group at http://groups.google.com/group/sage-support?hl=en.
>
>



-- 
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
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.
Visit this group at http://groups.google.com/group/sage-support?hl=en.


Reply via email to