On 05/27/2017 06:14 PM, boB Stepp wrote: > Hello Jalen! > > On Sat, May 27, 2017 at 4:19 PM, Jalen Barr <jalenba...@gmail.com> wrote: >> >> In this code it always changes the PlaceHolder to 0 no matter what Month is >> set to >> >> Month ="September" >> >> if Month == "January" or "1": >> PlaceHolder = 0 > > This must be written as: > > if Month == "January" or Month == "1": > PlaceHolder = 0 > > The way you wrote it is interpreted as: > > if (Month == "January") or ("1"): > PlaceHolder = 0
and since "1" is always True, PlaceHolder is always set to 0. FWIW, if checking for multiples, you could also write: if Month in ['January', '1']: _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor