Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Python Basics Functions and Looping While Loops

even the right password is wrong...

here is my code... is there is a difference, I can't see it.

import sys


password = input("Please enter the super secret password:  ")
attempt_count = 1
while password != 'openseseme':
    if attempt_count > 3:
        sys.exit("Too many invalid password attempts")
    pasword = input("Invalid password, try again:  ")
    attempt_count += 1
print("Welcome to Secret Town")

what I got was: treehouse:~/workspace$ python password_checker.py
Please enter the super secret password: 1234567
Invalid password, try again: 234567
Invalid password, try again: openseseme
Invalid password, try again: 1234567
Too many invalid password attempts

What am I missing?

2 Answers

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,457 Points

Hey Amy Tomey, there is a typo.

The inner input is assigned to pasword instead of password

Post back if you need more help. Good luck!!!

THANKS! I couldn't see the forest for the trees.