+ 1
Inputting changing data
Using python, how do u enter a code that can allow one to enter different values. For instance, if a business person sales items and enters the different number of items sold and their prices.
4 odpowiedzi
+ 3
It seems you just start to learn how to code.
In a real life scenario, information about certain objects usually stored in a database.
For example, the barcode scanner in a supermarket is connected to a database which stores the item selling price.
For teaching purpose, it can be done with python alone. You can use a dictionary object to store the information in memory. (Take the Python Intermediate courses to learn more about dictionary.)
And the code would be look something like this.
https://sololearn.com/compiler-playground/caZxgXC42Vpf/?ref=app
+ 1
you have to set up a database for that.
0
sqlite3 is a database that's natively available in Python. But it's more complex and not for beginners.
0
Muito bom