AL-2020/product.py

32 lines
626 B
Python

from coder import create_image
class Product:
def __init__(self, color, shape, mass, size):
self.color = color
self.shape = shape
self.mass = mass
self.size = size
class FinalProduct:
def __init__(self, color, shape, mass, size, name):
self.color = color
self.shape = shape
self.mass = mass
self.size = size
self.name = name
if size == 'small':
self.price = 2.99
if size == 'medium':
self.price = 3.99
if size == 'big':
self.price = 4.99
self.img = create_image(self)