A certainl part of an if() structure never gets executed.

Νικόλαος Κούρας support at superhost.gr
Wed Jun 12 06:45:16 EDT 2013



-------- Original Message --------
Subject: Re: A certainl part of an if() structure never gets executed.
Date: Wed, 12 Jun 2013 10:07:39 +0100
From: Fábio Santos <fabiosantosart at gmail.com>
To: Νικόλαος Κούρας <support at superhost.gr>
CC: python-list at python.org <python-list at python.org>
Newsgroups: comp.lang.python
References: <2bc90d3b-09c2-4315-9357-ff7f039465e0 at googlegroups.com> 
<kp9bcq$o1i$2 at dont-email.me> <kp9d02$1jfb$1 at news.ntua.gr>

On Wed, Jun 12, 2013 at 9:54 AM, Νικόλαος Κούρας <support at superhost.gr> 
wrote:
 > but if enumerate yields 0 instead of '==========' then elif '=' not in
 > year of course fails.
 >
 > So, i must tell:
 >
 > for i, month in enumerate(months):
 >     print('<option value="%s"> %s </option>' % (i, month) )
 >
 > to somehow return '==========' instead of 0 but don't know how.
 > --
 > http://mail.python.org/mailman/listinfo/python-list

Well, you could try this:

 > for i, month in enumerate(months):
 >     if i == 0:
 >         month = ('=' * 10)
 >     print('<option value="%s"> %s </option>' % (i, month) )

No?

You can see if for yourself if you go to:
http://superhost.gr/?page=pelatologio.py

bottom down where the form drop down menus are:

search will work but f the suer just gives out the year it will never 
make it to the specific if() branch.






More information about the Python-list mailing list