Pack 1 · Challenge 3 of 5 · 10 XP · ⏱ 4 min
Password Gate
🔐 Bots guard doors too. Compare text with ==: one equals sign sets a variable, two compare.
answer = input("Ready? ")
if answer == "yes":
print("Let's go!")
else:
print("Take your time.")When you press Run, a box asks you for the password. When you Submit, the checker tries the right password and a wrong one.
Instructions
- Ask
input("Password: ")and store it inguess. - If
guessisopen sesame, printWelcome in! - Otherwise print
Nope. Try again.
💡 Hint
if guess == "open sesame": then print("Welcome in!"), and under else: print("Nope. Try again.").
bot.py
Terminal