On Nov 8, 12:01 pm, Alastair Irving <alastair.irv...@sjc.ox.ac.uk>
wrote:
> On 08/11/2011 16:52, Chappman wrote:
>
> > Hi folks,
>
> > When I try and do to two arguments in the same lines in sagemath it
> > does not compute, this is what I have written:
>
> >    if A==1 and D==1 then case<- 1 else
> >    if A==2 and D==1 then case<- 2
>
> Hi
>
> This is not the correct syntax for an if statement in Python.  You
> should replace "then" by a ":".  Also <- does not do an assignment,
> which I think is what you're trying to do.  I think what you want is
>
> if A==1 and D==1: case=1
> elif A==2 and D==1: case=2
>

Python is pretty easy to learn, luckily.  For some resources, see
http://www.sagemath.org/help.html#furtherResources (bottom).

Incidentally, Minh or Harald, that list of Python resources should be
updated in two ways
 * Add http://greenteapress.com/thinkpython/, an excellent resource
 * Change Dive into Python to http://www.diveintopython.net/ or
another similar one, as the author essentially vanished from the
internet about a month ago (see 
http://meyerweb.com/eric/thoughts/2011/10/04/searching-for-mark-pilgrim/,
for example) and that link gives a rather nasty error.

- kcrisman

-- 
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
URL: http://www.sagemath.org

Reply via email to