On Thu, Nov 5, 2009 at 8:44 PM, Katt <the_only_kat...@verizon.net> wrote:

> <snip>
> Currently the above code does not work unless I change the "if" statement
> to say:
> "if check_year == "c".
>
> Did I do the slice incorrectly?  I thought that when you take the first
> location (0) of a list then it would take the "cyear" in stead of just the
> "c".
>
>
It works correctly for me. Try modifying your code:

date = "cyear_11_05"
date2 = date.split("_")
check_year = date2[0]
print check_year

what does that do for you?
-Wayne
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to