Storage in python | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Storage in python

in python How do you store data from the input() function so that it is retained and can be updated every time the program is run.

11th Apr 2020, 7:34 PM
Nwanakwoakwo Wid'obiagu (kenneth Anyanwu)
Nwanakwoakwo Wid'obiagu (kenneth Anyanwu) - avatar
3 Answers
+ 5
If you need to have access to values at each time a programm is executed, you can store the desired values in a json file or may be in simple text files, or if you like, you can also use a local database like sqlite.
11th Apr 2020, 7:50 PM
Lothar
Lothar - avatar
+ 2
You can save the data in a file, or in a database. The easiest database is sqlite3 which is already built into standard python. These methods will work on your conputer but SoloLearn cannot keep any data between sessions, unless you send it to an external (remote) database.
11th Apr 2020, 7:58 PM
Tibor Santa
Tibor Santa - avatar
0
The function returns a string that can be assigned to a variable. The value of the variable can be changed .
11th Apr 2020, 7:37 PM
Oma Falk
Oma Falk - avatar