[Tutor] python question

Daniel J Kramer constantfables at gmail.com
Tue Nov 25 18:45:41 CET 2008


Hi Kent

got it!  Is it because Python must recognize the answer as lower case?
sorry if that might seem like a dumb question, but I am looking to
understand this program.

cheers
Daniel


On Tue, Nov 25, 2008 at 12:38 PM, Kent Johnson <kent37 at tds.net> wrote:

> On Tue, Nov 25, 2008 at 11:52 AM, Daniel J Kramer
> <constantfables at gmail.com> wrote:
> > Hi Kent
> >
> > I have been playing with the ,lower command and am not having much luck.
>  It
> > seems like a simple task, but it is not working for me.  Here is the code
> >
> > def main():
> >     score = 0
> >         print"Welcome to the Music Quiz.  Today's game has 8 rounds for
> you.
> > There will be audio rounds, visual rounds and straight ahead qustions. We
> > will begin with the round Journey to the Centre of New York"
> >         print
> >         A11 = raw_input ("We see the Ramones on the Bowery with rolled up
> > towels under their arms chewing out a rhythm on their bubble gum.  Where
> are
> > they planning to hitch a ride? ")
> >         A11 = A11.lower()
>
> A11 now contains all lowercase characters.
>
> >           if A11 == "Rockaway Beach" :
> try
>  if A11 == "rockaway beach":
>
> Kent
>
> PS Please use Reply All to reply to the list.
>
> >                 score += 5
> >              print "Correct"
> >          elif A11 == "CBGB" :
> >                    print "That's where they are, not where they are
> going"
> >         else:
> >                print "Wrong, they all hitched a ride to Rockaway Beach"
> >
> >         print "Your total score ", score
> >
> > main()
> >
> > Is the placement of the .lower function in the wrong place?  When I run
> the
> > code, the program does not recognize my input and will not give me a
> score.
> > This happens even if I enter text with capitals.  When I remove the
> .lower
> > function Python recognizes my answer, but only if it has capitals.
> >
> > any suggestions?
> >
> > cheers
> > Daniel
> >
> >
>



-- 
Daniel J Kramer
Constant Fables
249 12th st #3
Brooklyn, NY 11215
(h) 347 223 4571
(m) 646 427 7430
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20081125/e0b9e918/attachment-0001.htm>


More information about the Tutor mailing list