Oh goddammmnitttt. I seem to be doing this a lot today. Look below for the extra addition to the code I posted.

Joal Heagney wrote:

Here's my contribution anycase:

count = 0
# Get first input
name = raw_input("Guess my name: ")
# Give the sucker two extra goes
while count < 2:
    # Check the value of name
    if name == 'Ben':
        print "You're right!"
        break
    else:
        name = raw_input("Try again: ")
          # Here's the bit I missed out.
          count += 1
# Of course, we haven't checked the sucker's last guess
# so we have to do that now.
if count == 2:
    if name == 'Ben':
        print "You're right!"
    else:
        print "No more tries for you!!!"


Hope this helps. Joal

GRRRRRRRR.

Joal
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to