Learn to Code via Tutorials on Repl.it!

← Back to all posts
Repl DB
FishballNooodle (184)

Repl DB doesn't allow you to list all keys using the command print(db.keys).
However, I found a way around this.
By using a for loop, I managed to get it to print every key.

from replit import db
for i in db:
    print(key)

Similarly, if you want to delete all key...

from replit import db
for i in db:
    del db[i]