[Tutor] Python Programming exercise
bermanrl at cfl.rr.com
Wed Jul 1 14:33:38 CEST 2009
1. Pay more attention to what ends an if statement (:) also watch your
2. Code is better than my commentary. This works the way you want it to
password = "qwerty"
guess = "0"
count = 0
while count != 3:
guess = raw_input("Enter your password: ")
guess = str(guess)
if guess != password:
print "Access Denied"
count = count + 1
print "Password Confirmed"
On Tue, 2009-06-30 at 19:53 -0700, Daniel Sato wrote:
> I have been going through some Python Programming exercises while
> following the MIT OpenCourseWare Intro to CS syllabus and am having
> some trouble with the first "If" exercise listed on this page:
> I have been able to make the module quit after entering a password
> three times, but can't get it to quit right away after the correct one
> is entered. I know this is really basic, please forgive me. I have
> no programming experience and have just started going through these
> My code is here:
> Daniel Sato
> Tutor maillist - Tutor at python.org
More information about the Tutor