[Tutor] help me to do my exercise

Alan Gauld alan.gauld at btinternet.com
Mon Mar 5 18:24:17 CET 2007


"Vasile Filat" <vasile.filat at gmail.com> wrote

> I just started learning Python from a book translated intro
> Russian. It is my first exercise from the book and I don't
> know why it is not working.

OK, First please send the code as text rather than as an image.
It makes it much easier to comment when we can cut n paste
sections into email.

Secondly please send along any error messages.

OK, Now looking at you code. Thee are several syntax errors
which python should be complaining about. The first I see is:

>  for i in sys.argvj 1:]:

I suspect the j should be a [

Next you have no indentation after the except:

also you have a colon after the continue plus a block of code.
continue just makes the loop go round again...

Next your test for y*100 == 0 will only pass if y is zero!

You only print the Gregorian result if y % 4 is zero, but
not if y%400 is zero...


That should be enough to keep you busy.
Please post text next time.

HTH,

-- 
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld

--------------------------------------------------------------------------------


> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
> 




More information about the Tutor mailing list