- json Module
We Used mainly two method
- json.loads() : we used json.load() which takes a file object and returns the json object and json object contains data in the form of key/value pair.
- json.dumps() : json.dumps() is a method that converts dictionary objects of Python into JSON string data format.
We can mainly perfom five action
- We can see all the poduct details like product name, poduct id,product quantity, product price.
- We can Update and add new product by filling product name, poduct id,product quantity, product price.
- We can purchase any product by product id and product quantity.
- We can see the list of all sales product name ,id,quantity.
- And last one we can exit the program.
There are two file
- record.json : In this file we contain all the data relted two products.
- sales.json : In this file we store the data of purchased products.
- If we enter choice more than 5 ,it will show invalid choice.
- If we try to purchase more product the it will show we have not more product quantity.