How to make a save function?
It's the title
Anyway, i'm making a pokémon game with 24 gyms so long i guess, i need save thanks.
@LTI2 Hi,
What do you mean by function, Is it def example():
?
Or it is the score or something?
If you want to store the score of the player, then you can something Database. There are lot of them but I suggest some of them like Repl DB, Mongo DB, etc.
Here are some tutorials on how to use Repl DB:-
https://docs.repl.it/misc/database
https://repl.it/talk/learn/Replit-DB/43305
Here are some tutorials on how to use Mongo DB:-
https://docs.mongodb.com/manual/tutorial/
https://www.w3schools.com/python/python_mongodb_getstarted.asp
https://www.tutorialspoint.com/mongodb/index.htm
That's it for me
Thanks!
Hope this helps
@PattanAhmed like def example():
@LTI2 Do you want to store score in a function?
@PattanAhmed yeah kinda
@LTI2 Ok, then.
Try using database inside a function.
There are some tutorials on how to use Database, that I have already mentioned them in the original post.
Instead of there tutorial, use them in a function.
That's it.
YAY THANKS EVERYBODY YOU ALL GET UPVOTES 🎉🎉🎉🎉🎉 @CarlosRosiles @Coder100 @PattanAhmed
GIVING AWAY FREE MONEY YAY jk
A database is a good thing to use! If its in Python, well your in luck! On the side of your repl editor, you will see some database stuff here:
A quick tip for saving numbers:
Do NOT declare it. Here is an example:
Do This:
I think you get the idea, anyways, hope this helps!
@CarlosRosiles okay thanks