Ask coding questions

← Back to all posts
How to hide a variable in Python Repl
ThisUserTaken (243)

How do you hide a variable? In this program, how do you hide the variable "secret" from other people seeing it when they run the repl. In this repl, they can just look at the repl and be like ez and enter the secret password

Answered by DynamicSquid (4919) [earned 5 cycles]
View Answer
DynamicSquid (4919)

You need to create a secret.

You can access them like this:

import os
print(os.getenv("password")) # assuming your secret key is "password"