-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpractice.py
More file actions
99 lines (70 loc) · 1.79 KB
/
Copy pathpractice.py
File metadata and controls
99 lines (70 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# import random
# products = {
# "apple": 100,
# "banana": 50,
# "milk": 120,
# "bread": 80
# }
# cart = []
# categories = ("Fruits", "Dairy", "Bakery")
# def show_products():
# print("\nAvailable Products:")
# for item, price in products.items():
# print(item, "-", price)
# def add_to_cart():
# item = input("Enter product name: ")
# if item in products:
# cart.append(item)
# print("Item added to cart")
# else:
# print("Product not found")
# def show_bill():
# total = 0
# order_id = random.randint(1000, 9999)
# print("\nOrder ID:", order_id)
# for item in cart:
# price = products[item]
# total += price
# print(item, "-", price)
# print("Total Bill:", total)
# while True:
# print("\n1 Show Products")
# print("2 Add to Cart")
# print("3 Show Bill")
# print("4 Exit")
# choice = input("Enter choice: ")
# if choice == "1":
# show_products()
# elif choice == "2":
# add_to_cart()
# elif choice == "3":
# show_bill()
# elif choice == "4":
# break
# else:
# print("Invalid choice")
# class Student:
# # class attribute
# college_name = "ABC College"
# def __init__(self, name, marks1):
# self.name = name
# self.m1 = marks1
# # method
# def avg(self):
# a = (self.m1 + self.m2 + self.m3)/3
# return a
# s1 = Student("Ali", [97,54,67])
# # s1.welcome()
# print(s1.name)
# print(s1.avg())
# class Car:
# def __init__(self):
# self.acc = False
# self.brk = False
# self.clutch = False
# def start(self):
# self.clutch = True
# self.acc = True
# print("Car started...")
# car1 = Car()
# car1.start()