[Tutor] Newbie Question

Danny Yoo dyoo@hkn.eecs.berkeley.edu
Tue, 23 Jul 2002 17:56:42 -0700 (PDT)


On Tue, 23 Jul 2002, Billie wrote:

> I am learning Python with the tutorial for non-programmers.

Hi Billie, welcome aboard!


> We are asked to write a program to keep track of how many times the user
> has entered the password wrong.  If more than 3 times, print "That must
> have been complicated"

Do you get your user's input by using a raw_input() call?  That would
probably be the way of getting someone to type the password.



> How do you count a string statement?  Everything I've tried asks for
> integers.  I feel really stupid because I can't work this out.

I don't think you need to count the string itself.  Instead, try to count
the number of times it takes for the user to get the password right.  I
think you may need to use something to check the user's input versus the
real password, like an 'if' statement.



If you have more questions, or if a particular answer was more than vague,
please feel free to ask for clarification.  *grin*

Best of wishes to you!