[Tutor] python question
Daniel J Kramer
constantfables at gmail.com
Tue Nov 25 18:45:41 CET 2008
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.
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.
> > 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
> > 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
> > they planning to hitch a ride? ")
> > A11 = A11.lower()
> A11 now contains all lowercase characters.
> > if A11 == "Rockaway Beach" :
> if A11 == "rockaway beach":
> 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
> > 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
> > code, the program does not recognize my input and will not give me a
> > This happens even if I enter text with capitals. When I remove the
> > function Python recognizes my answer, but only if it has capitals.
> > any suggestions?
> > cheers
> > Daniel
Daniel J Kramer
249 12th st #3
Brooklyn, NY 11215
(h) 347 223 4571
(m) 646 427 7430
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor