+ 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.

6th Dec 2024, 1:08 PM
Dennis Wambua Sikuku
Dennis Wambua Sikuku - avatar
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
7th Dec 2024, 3:23 AM
Wong Hei Ming
Wong Hei Ming - avatar
+ 1
you have to set up a database for that.
6th Dec 2024, 1:57 PM
Bob_Li
Bob_Li - avatar
0
sqlite3 is a database that's natively available in Python. But it's more complex and not for beginners.
7th Dec 2024, 5:11 AM
Bob_Li
Bob_Li - avatar
0
Muito bom
8th Dec 2024, 1:27 AM
Edgard Roberto
Edgard Roberto - avatar