Learn to Code via Tutorials on Repl.it!

← Back to all posts
🐍 Python Data Base Tutorial 📄
[deleted]

🐍 Python Data Base Tutorial 📄

>:)

You may already know, because it is on the side of every repl. But...whatever.

Defnition

Key storing allows you to retrieve the data stored even if your code is erased or the program is off.

Data Base Location

Click where the arrow is pointing. Then you should come to a page like this:

I know it shows everything there, but I'm going to clarify things in this tutorial.

1. Importing

Import the module:

2. Giving a key a value

There's no point for data bases if you don't store things.

3. Get a key's value

Now you stored something, how do you see that key's value?

Delete a key

If you want to delete a key,

List all of the keys

If you want to see all the keys you stored:

List keys with a prefix

It's like how it sounds, list keys with a prefix.

That's it for this tutorial. Very simple :|.

Anyways...check out my python tutorial: https://repl.it/talk/learn/Python-The-Basics/117133

Getkey function tutorial:
https://repl.it/talk/learn/GetKey-Function-Tutorial/116955

Peace for now...✌

EDIT: if you want to list all the keys, don't do keys = db.keys(), it won't print anything. Also, don't do print(keys) after you defined keys because it will print a bunch of weird stuff. This is the correct way:

Voters
OmegaWolf
Loshad
IvanPuentes
parkerslv
BananaJellyfish
TsunamiOrSmth
mrsamed
RhinoRunner
Comments
hotnewtop
RhinoRunner

noice. Maybe explain what the key storing does?

RhinoRunner

@XThacker owo ping me when its ready.
Its still a good tutorial, I updooted

[deleted]