๐Ÿ PyQuest๐Ÿ•น๏ธ Challenge Arcade ยท ๐Ÿ” Password Gate
โญ 0 XP๐Ÿ Python is waking upโ€ฆ

Password Gate ๐Ÿ”

An if asks once. A while keeps asking until it gets what it wants โ€” like a little sibling. ๐Ÿ˜…

guess = input("Password? ")

while guess != "dragon":
    print("๐Ÿšซ Wrong! Try again.")
    guess = input("Password? ")

print("๐Ÿ”“ ACCESS GRANTED!")

!= means "is not equal to". So that loop says: while the guess is not the password, keep going round.

โš ๏ธ Super important: you must ask again inside the loop. If you forget, guess never changes, the loop never ends, and your program spins forever. (Hit โน Stop if that happens โ€” it's happened to every programmer alive.) ๐ŸŒ€

Your mission

Build a password gate:

  1. Pick a secret password
  2. Keep asking with a while loop until they type it exactly right
  3. Tease them for every wrong guess ๐Ÿ˜ˆ
  4. Print a triumphant message when they finally get in

Your code

Press โ–ถ Run to see what your code does!