Hi, I'm quite a newbie in programming, so this would seem a little lame quesion but I need your help!
So I started learning Python, but I encountered a problem I can't cope with. My task is to "Write a program that has a user guess your name, but they only get 3 chances to do so until the program quits."(hey dont start laughing!
I've written something but I can't make him to work properly:
my_name = "Squirrel"
a = 0
guess = raw_input ("What's my name?")
while a != 3:
if guess == my_name:
print "That's it!"
print "Try again."
a = a + 1
I've tried several ways to do that task but I've always ended up in looping. Could somebody please help me telling what am I doing wrong?
0 · ·