Share your repls and programming experiences

← Back to all posts
Stocks Simulator
RishiMohanty

Stocks Simulator:

-Buy Stocks
-Sell Stocks
-Go Big or Go Home

CAN YOU GET ON THE LEADERBOARD??

Voters
RishiMohanty
ch1ck3n
Comments
hotnewtop
MrVoo

Replit database doesn't work with console projects.

RishiMohanty

@MrVoo Really? Hmmm... It Works If I Run It

MrVoo

@RishiMohanty That's because you own the repl :P

ch1ck3n

@MrVoo stop sending false information

Repl database works whoever is running the project, and even on console projects!

RishiMohanty
MrVoo

@ch1ck3n Then how come it never works that way for me? :/

RishiMohanty

@MrVoo Your Probably doing it wrong

RishiMohanty

@MrVoo
https://docs.replit.com/hosting/database-faq

from replit import db

Insert →
Set
a key to a value
db["
key
"] = "
value
"

Insert →
Get
a key's value
value = db["
key
"]

Insert →
Delete
a key
del db["
key
"]

Insert →
List
all keys
keys = db.keys()

Insert →
List
keys with a prefix
matches = db.prefix("
prefix
")

Insert →

MrVoo

@RishiMohanty @ch1ck3n This project doesnt work for me because of replit database, I think it needs to be a web server project, not 100% console

ch1ck3n
RishiMohanty

@MrVoo Does It Give You an error? if it does what is the error

RishiMohanty

@ch1ck3n It gave an error since you forgot to set an initial value to 'poop'. I fixed it through the console

ch1ck3n

@RishiMohanty haha you said poop

MrVoo

@ch1ck3n funniiiiiiiiiiiiiiiiiii

RishiMohanty

@MrVoo uhhhhhhhhhhhhhhhhhhh... Okay?