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

Νικόλαος Κούρας support at superhost.gr
Wed Jun 12 05:19:31 EDT 2013


On 12/6/2013 12:07 μμ, F�bio Santos wrote:
> 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?

I'am afraid not Fabio, i just tried byt sumbitting only the year, not 
name not month

after printign the valeus to see what went wrong, the values look like:

========== 0 2010

instead of:

========== ==========  2010

========== is the value of the month when its not selected by the user, 
but even with your suggestions it reurns t0 intead of the equal signs.....




More information about the Python-list mailing list