[Tutor] Newbie Question Again
Billie
bjmartin98@pennswoods.net
Thu, 25 Jul 2002 20:58:16 -0400
This is a multi-part message in MIME format.
------=_NextPart_000_0009_01C2341D.FF6FAD00
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
First of all I would like to thank all the people who have answered my =
first question...Andrei, Kirk, and Danny.
My question was not asked correctly. So bear with me while I ask again, =
OK?
I am using Python 2.2 for windows. I am using Josh C.'s =
Non-Programmers Tutorial for Python. We have only studied the While and =
the If statements so far. We haven't studied lists yet.
We are given the following exercise:
# Modify the password guessing program to keep track of=20
# how many times the user has entered the password
# wrong. If it is more than 3 times, print "That must have=20
# been complicated."
Password.py
# Note that this must not be the password so that the
# while loop runs at least once.
password =3D "foobar"
while password !=3D "unicorn":
password =3D raw_input("Password:")
print "Welcome in"
I don't understand how to count the users input, I've tried to do a few =
things but I either get can't add strings and integers, or asks for =
integers.
We were shown the fibonnacci sequence which has a counter in it but it =
is for integers.
I am not asking for you guys to solve the problem only but maybe explain =
why your way works.
I hope I'm not asking too much, I just want to understand.
Thanks in advance,
Billie
------=_NextPart_000_0009_01C2341D.FF6FAD00
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4522.1800" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>First of all I would like to thank all =
the people=20
who have answered my first question...Andrei, Kirk, and =
Danny.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>My question was not asked =
correctly. So bear=20
with me while I ask again, OK?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I am using Python 2.2 for =
windows. I am using=20
Josh C.'s Non-Programmers Tutorial for Python. We have =
only studied=20
the While and the If statements so far. We haven't studied lists=20
yet.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>We are given the following =
exercise:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2># Modify the password guessing program =
to keep=20
track of </FONT></DIV>
<DIV><FONT face=3DArial size=3D2># how many times the user has entered =
the=20
password</FONT></DIV>
<DIV><FONT face=3DArial size=3D2># wrong. If it is more than 3 =
times, print=20
"That must have </FONT></DIV>
<DIV><FONT face=3DArial size=3D2># been complicated."</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Password.py</FONT></DIV>
<DIV><FONT face=3DArial size=3D2># Note that this must not be the =
password so that=20
the</FONT></DIV>
<DIV><FONT face=3DArial size=3D2># while loop runs at least =
once.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>password =3D "foobar"</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>while password !=3D =
"unicorn":</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> password =3D=20
raw_input("Password:")</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>print "Welcome in"</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> I don't understand how to count =
the users=20
input, I've tried to do a few things but I either get can't add strings =
and=20
integers, or asks for integers.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>We were shown the fibonnacci sequence =
which has a=20
counter in it but it is for integers.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I am not asking for you guys to solve =
the problem=20
only but maybe explain why your way works.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I hope I'm not asking too much, I just =
want to=20
understand.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Thanks in advance,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Billie</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV></BODY></HTML>
------=_NextPart_000_0009_01C2341D.FF6FAD00--