i know how to delete a single key but i want to delete them all, how do i do that.
i tried this code:
from replit import db
keys = str(db.keys())[1: -1]
print(keys)
del db[keys]
: the printing works but it doesn’t delete any thing it gives me an error.
2 Likes
You could use a for loop, but replit db has a nice function called db.clear(), which does the same thing with less space.
4 Likes
Sky
4
I just do:
for x in db.keys():
del db[x]
1 Like
system
Closed
5
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.