Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7a842cc

Browse files
committed
In progress
1 parent c65d834 commit 7a842cc

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Welcome to PythonProjects, a repository filled with exciting and educational Pyt
1616
- [Tic Tac Toe](#tic-tac-toe)
1717
- [Typing Speed and Accuracy Test](#typing-speed-and-accuracy-test)
1818
- [Memory Tiles](#memory-tiles)
19-
19+
2020
- [Intermediate Level Projects](#intermediate-level-projects)
2121
- [Snake Game](#snake-game)
2222
- [Pong Game](#pong-game)

grocery/AvailableProduct.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
Product_name Product_price
21
Tooth brush 20
32
paste 40
43
dal 56

grocery/main.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
AvailableProductDict = {}
2+
13
#welcome message for the customer
24
CustomerName = input("Enter your name: ")
35
WelcomeMessage = f"welcome to our store {CustomerName}"
@@ -15,6 +17,27 @@
1517
Product_file.close()
1618

1719
#iterate one by one all products present in the text file
20+
print("*************** items present in the store ******************")
1821

1922
for i in file_lines:
20-
print(i)
23+
item_name = i.split()[0]
24+
item_price = i.split()[1]
25+
print(f"{item_name} : {item_price}")
26+
AvailableProductDict.update({item_name : item_price})
27+
28+
# print(AvailableProductDict)
29+
30+
31+
print("*************** items present in the store ******************")
32+
33+
34+
#getting permission from the user whether they want to proceed or not
35+
36+
ProceedMsg = input("Do you want to proceed? (Y/N)")
37+
38+
if ProceedMsg.lower() == "yes":
39+
itemEntered = input("Enter the item that you want to add to your cart: ")
40+
if itemEntered.title() in AvailableProductDict:
41+
42+
else:
43+
print("Please come back again!!!")

0 commit comments

Comments
 (0)