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 trialEswar Ambati
890 PointsMy console isn't responding the way it should
password = input("Please input enter the super secret password: ") while password != 'opensesame': password = input("Invalid password, try again:") print("Welcome to a secret town")
I had typed this code into the console when I first typed in an invalid password. However, unlike in the video where is said welcome to a secret town It just kept on saying invalid password try again when I typed in opensesame in the console multiple times
Stu Cowley
5,801 PointsThe above code, but formatted ?
password = input("Please input enter the super secret password: ")
while password != 'opensesame':
password = input("Invalid password, try again:")
print("Welcome to a secret town")
priyanka shukla
3,051 Pointsasking too late !!! have you solved this problem
2 Answers
Ramkumar Ganesan
16,548 Pointsi think i know the answer. You are running python instead of python3, which is the newest version. If you run python, you have to use raw_input instead of input, or else it will only work if your password is in quotation marks, as such 'opensesame'. Try running python3, just type python3 instead of python. If that doesnt work, change your code to this:
password = raw_input("Please input enter the super secret password: ")
while password != 'opensesame': password = raw_input("Invalid password, try again:")
print("Welcome to a secret town")
Jose Salazar
9,393 PointsRunning on Linux, and this worked for me. Thanks for the answer!
Alex Olivera
Full Stack JavaScript Techdegree Student 6,506 PointsThank you Ramkumar!
cem günaltay
1,332 PointsHaving the same problem as like esmar. Can't fix it anyway. Somebody to help?? Console repeats and locks saying "Please try again" I don't have problem when password is true
Kirsten Smith
3,484 PointsKirsten Smith
3,484 PointsCould you format your code with the Markdown Cheatsheet https://teamtreehouse.com/community/cheatsheet It could be a problem with the indenting but I can't tell in this format.