forked from cbreddy69/python-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuntitled0.py
More file actions
60 lines (46 loc) · 1.41 KB
/
untitled0.py
File metadata and controls
60 lines (46 loc) · 1.41 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
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 30 13:04:07 2019
@author: Raghu Prasad
"""
class product(object):
def __init__(self,no,itemname,itemprice,capacity):
self.itemname=itemname
self.itemprice=itemprice
self.no=no
self.capacity=capacity
def productname(self):
return self.itemname
def productprice(self):
return self.itemprice
def productno(self):
return self.no
class user(object):
def __init__(self,name,phone,email):
self.name=name
self.phone=phone
self.email=email
self.cartlist={}
def addproduct(self,product):
for a in self.product:
cartlist={
'no':product.no,
'itemname':product.itemname,
'itemprice':product.itemprice
}
self.product.append(cartlist)
print('{} has been added.'.format.append(item.name))
def addcustomer(self,user):
for user in object:
self.append(user.name)
class cart(dict):
def buyproduct(product,user):
print('enter the object',itemname)
if itemname in product:
cart.append(itemname)
cart.append(itemprice)
def removeitem(self,itemname):
for value in self.product:
if value['itemname']==itemname:
value[capacity]=None
self.cart.remove(itemname)