> In ' while ' or ' for ' loop in Sage, can one use ' { ' and ' } '
like C program?
No. In Python (the language you are using when you write Sage code) use
indentation to indicate blocks of code.
for i in range(100):
print i
print i^2
See
http://docs.python.org/tutorial/introduction.html?highlight=indentation#first-steps-towards-programming
for a longer introduction.
Thanks,
Jason
You an also use comments if you want to have some sort of explicit end
marker.
for i in range(100):
print i
print i^2
# end for
I used to do that when I was first learning Python.
William
> --
> To post to this group, send email to sage-s...@googlegroups.com
> To unsubscribe from this group, send email to sage-support...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org
>