How to add a secret input?

I want to add an input which can be access using my secret, ‘PASSWORD_TO_ENTER_GAME’. if i’m not doing this correctly, Please reply.

Repl link:
https://replit.com/@Stickpion/Diamond-Hunting

And this is what i tried

Game = input("This game is not yet released. If you are a dev, type the password to continue.")
if Game == 'PASSWORD_TO_ENTER_GAME':
  #Continue
  else:
    print("Ya you trying to leak the game huh?")
    print("You are not a dev. You are not allowed to continue.")
    exit()

This is the code you need, to know more about Secrets and environments variables you can learn more in the Replit Docs!

import os

Game = input("This game is not yet released. If you are a dev, type the password to continue.")
if Game == os.environ["PASSWORD_TO_ENTER_GAME"]:
  #continue
else:
    print("Ya you trying to leak the game huh?")
    print("You are not a dev. You are not allowed to continue.")
    exit()
2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.