\ can be used when one wants to slip a line , in a long line
for example
plot(sin(x),x,0,2, color="red",figsize=3,
\fontsize=8,frame=True)
in fact here is not really useful it's just for the example, because in
a jupyter notebook, if you write after a gomma and press "enter" the
next line will be indented
Le 20/01/2019 à 02:35, 'Justin C. Walker' via sage-support a écrit :
On Jan 19, 2019, at 17:23 , Anton Sherwood <bro...@pobox.com> wrote:
On 2019-1-19 15:52, MAMANE DJAMILOU Salissou Dango wrote:
Bonjour,
je suis un tous nouveau utilisateur de sagemath. Je maîtrise les opérations
indépendantes. Mon souci se trouve au nivaux des algorithmes. je n'arrive,
jusque là pas à comprendre comment programmer avec sageMath (voir les
''screenshots'').
merci de m'aider à démarrer.
An attempt at translation:
Good day,
I am a very new user of sagemath. I am mastering independent operations. My
trouble is on the level of algorithms.
So far, I cannot understand how to program with sageMath (see the screenshots).
Thanks for helping me to get started.
The problem is the use of “\”. Python programs are structured by indentation,
so the way to type the program in an editor, at the command line prompt, or in
the notebook, is as follows:
def fac(n):
if n == 1:
print ‘bonjour’
else:
print “bonsai”
The OP was entering the code almost correctly, but the “\” caused the parser to
ignore the new-line, and string everything together as one line.
HTH
Justin
--
Justin C. Walker
Director
Institute for the Enhancement of the Director's Income
--
Fame is fleeting, but obscurity
just drags on and on. F&E
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.