Python Project
Python Project
PROJECT
ONLINE SHOPPING
AIM:
Python Project - ONLINE SHOPPING
This is a hypothetical website of our online shop to illustrate the
di erent components that make up a good online shopping website.
KEY CONCEPTS:
The key concepts of the online shopping system are as follows:
User Authentication: Users can sign up with their email address and
password. The system securely stores the password using the MD5
hashing algorithm.
User Interface: The system provides a user interface for users to log
in, view available products, place orders, and cancel orders.
Admin Interface: The system provides an admin interface for
managing the inventory, including adding and removing items,
displaying the menu, and tracking income and loss.
2
Order Placement: Users can place orders by selecting a product,
specifying the quantity, and confirming the order. The system
updates the availability of the product and calculates the total
amount.
Order Cancellation: Users can cancel orders by providing the order
ID. The system removes the order from the placed orders list.
Income and Loss Tracking: The system calculates the total income
or loss by subtracting the total cost of the products from the total
revenue.
CODE STRUCTURE:
adminLogin(): Displays the admin menu.
adminDisplayMenu(): Displays the inventory menu.
addItem(): Adds items to the inventory.
removeItem(): Removes an item from the inventory.
goods(): Displays the total available goods.
incomeLoss(): Calculates and displays the total income or loss.
adminChoice(): Handles the admin's choice and calls the
corresponding function.
userLogin(): Displays the user menu.
userDisplayMenu(): Displays the available products.
placeOrder(): Allows users to place an order.
cancelOrder(): Cancels a placed order.
userChoice(): Handles the user's choice and calls the
corresponding function.
signup(): Allows users to sign up.
login(): Allows users to log in.
3
main(): The main function that handles the login system
and menu options.
4
SOURCE CODE:
5
3. Function block for admin display menu
6
6. Function block for the availability of goods
7
8. Function block for admin choice
8
11. Function block for user id
9
13. Function block for canceling the order
10
15. Function block for signing up
11
16. Function block for login
12
17. Function block starting the usage of code
13
Output:
14
After signing in, the 4 options will appear. If the 1st option
is chosen, then this will be the output
15
If the 2nd one is chosen, then this will be the output
16
The menu is yet again displayed:
17
Once logged in as admin these 6 options will appear for
the admin to choose. When option 1 is selected, this will
be the output:
18
19
If the 3rd option is selected this will be the output
20
If the 4th choice is selected this will be the output
21
If the 6th log out is selected this will be the output
22
THANK YOU
23