예제 #1
0
from product import Product

store1 = Store('Target')
store2 = Store('Walmart')
store3 = Store('Best Buy')

product1 = Product('macbook',1000,'laptop',1)
product2 = Product('mac pro',3000,'desktop',2)
product3 = Product('iphone',1000,'cell phone',3)
product4 = Product('beats',350,'headphone',4)
product5 = Product('ipad',600,'tablet',5)
product6 = Product('xdr',5000,'monitor',6)

print(store1.name)
print(store1.products)
store1.add_product(product1)
store1.add_product(product2)
print(store1.products)
store1.sell_product(1)
print(store1.products)

print(store2.name)
store2.add_product(product3)
store2.add_product(product4)
store2.inflation(.05)
print(store2.products[0].print_info())

print(store3.name)
store3.add_product(product5)
store3.add_product(product6)
store3.set_clearance('monitor', .05)
예제 #2
0
from store import Store
from product import Product

myStore = Store("Corner Bakery", "15 Main Street", "Mrs Fields")

myStore.add_product(Product(15, "Hammer", "15kg", "Brand A"))
myStore.add_product(Product(12, "Nail", "5kg", "Brand B"))
myStore.add_product(Product(17, "Saw", "10kg", "Brand C"))
myStore.inventory()

myStore.products[0].add_tax(0.05).sell()
myStore.products[1].add_tax(0.05).sell().return_item("opened")
myStore.products[2].add_tax(0.05).sell().return_item('defective')
myStore.inventory()

myStore.remove_product("Saw")
myStore.inventory()
from product import Product
from store import Store

amazon = Store('Amazon')
amazon.add_product(Product('Apple Watch', 450, "Accessories")).add_product(
    Product('Ray Ban Wayfarers', 100, "Accessories")).add_product(
        Product('Board Shorts', 50, "Outerwear"))
print(amazon.products)

amazon.inflation(0.02)
print(amazon.products[0].price)

amazon.set_clearance('Accessories', 0.15)
print(amazon.products[1].price)

# sensei bonus check
print(amazon.products[2].id)
예제 #4
0
from store import Store
from product import Product

beer = Product(5.0, "Lager", 1, "Yeungling", 3.00)
soda = Product(1.25, "Diet Coke", 1, "Coca Cola", 0.50)
toy = Product(20.0, "Lego Batman", 2, "Lego", 5.50)

nicks_store = Store("Philadelphia", "Nick")
nicks_store.add_product(beer).add_product(soda).add_product(toy).inventory()

print nicks_store
예제 #5
0
from store import Store
from product import Product

dollar_store = Store("Dollar Store")
candy = Product("candy", 1.00, "food")
milk = Product("milk", 2.00, "food")
paper = Product("paper", 1.00, "office")
pencil = Product("pencil", 2.00, "office")

dollar_store.add_product(candy).add_product(milk).add_product(
    paper).add_product(pencil)

dollar_store.print_catalog()
print("\nSELLING")
dollar_store.sell_products(1).sell_products(2)
print("\n")
dollar_store.print_catalog()

# milk.update_price(.5, True)

# dollar_store.print_catalog()

# milk.print_info()
# print()
# dollar_store.print_catalog()

# print()
# print("SELLING")
# dollar_store.sell_products(1)
# print()
# dollar_store.print_catalog()
예제 #6
0
from store import Store
from store import Product

apple = Store("Apple")
iphone4 = Product("iPhone 4", 300, "Phone")
iphone5 = Product("iPhone 5", 500, "Phone")
iphone6 = Product("iPhone 6", 700, "Phone")

ipad_air = Product("iPad Air", 500, "iPad")
ipad_pro = Product("iPad Pro", 2000, "iPad")

imac_air = Product("iMac Air", 1000, "Laptop")
imac_pro = Product("iMac Pro", 4000, "Laptop")

apple.add_product(iphone4).add_product(iphone5).add_product(
    iphone6).add_product(ipad_air).add_product(ipad_pro).add_product(
        imac_air).add_product(imac_pro)

for product in apple.products:
    product.print_info()

print("**********Inflation**********")
infation_percent = 0.10
apple.inflation(infation_percent)
for product in apple.products:
    product.print_info()

print("**********Clearance**********")
sale_category = "iPad"
sale_percent = 0.30
apple.set_clearance(sale_category, sale_percent)
예제 #7
0
from products import Products
from store import Store

apple = Products({"category": "fruit", "name": "apple", "price": .5})
orange = Products({"category": "fruit", "name": "orange", "price": .8})
banana = Products({"category": "fruit", "name": "banana", "price": .6})

carrot = Products({"category": "vegetable", "name": "carrot", "price": 1})
potato = Products({"category": "vegetable", "name": "potato", "price": 2})
onion = Products({"category": "vegetable", "name": "onion", "price": 1.5})

hat = Products({"category": "clothing", "name": "hat", "price": 10})
boots = Products({"category": "clothing", "name": "boots", "price": 20})
gloves = Products({"category": "clothing", "name": "gloves", "price": 6})

store_1 = Store("Bob's Store")
store_2 = Store("Bill's Store")

store_1.add_product(apple).add_product(carrot).add_product(gloves).add_product(
    onion).list_of_inventory()
store_1.sell_product(3).list_of_inventory().inflation(
    .2).list_of_inventory().set_clearance("clothing", .1).list_of_inventory()
예제 #8
0
from store import Store
from product import Product

store = Store("Abu Yousef")
store.add_product(["lipton"], 5, "tea", 1)
store.add_product(["xl"], 4, "drink", 2)
store.add_product(["nescafe"], 0.1, "neccessity", 3)
store.add_product(["test"], 10, "test", 4)
store.set_clearance("drink", 0.02)
store.inflation(0.05)
store.sell_product(2)
for i in range(len(store.list)):
    print(f"Name: {store.list[i].name}, Price: {store.list[i].price}")
store.print_info()
예제 #9
0
                 '1 lb 10.8 oz',
                 'Calvin Klein',
                 color='Cashew')
purse5 = Product(54.99,
                 'Card Holder',
                 '2.6 oz',
                 'Michael Kors',
                 color='Light Pewter')
purse6 = Product(54.99,
                 'Card Holder',
                 '2.6 oz',
                 'Michael Kors',
                 color='Soft Pink')

#add some products to store
store1.add_product(shoes1).add_product(shoes2).add_product(shoes3).add_product(
    shoes4).add_product(shoes5)
store1.add_product(shoes6).add_product(shoes7).add_product(shoes8).add_product(
    shoes9).add_product(shoes10)
store1.add_product(shoes11).add_product(purse1).add_product(
    purse2).add_product(purse3).add_product(purse4)
store1.add_product(purse5).add_product(purse6)

#apply a storewide brand sale
store1.brand_sale('Kate Spade', 20)
store1.brand_sale('Nine West', .30)

#check the inventory (should see sale price for Kate Spade AND Nine West brands)
store1.inventory()

#remove storwide brand sale
store1.remove_sale('Kate Spade')
예제 #10
0
from store import Store

Supermart = Store()
Supermart.add_product('apple', 0.60, 'produce').add_product('orange', 0.90, 'produce')
Supermart.sell_product(0).product_info('apple')
Supermart.add_product('banana', .32, 'produce')
Supermart.change_price('orange', 0.02, True)
Supermart.product_info('orange')
Supermart.inflation('orange', 0.2)
Supermart.product_info('orange')
Supermart.set_clearence('produce', 0.2)
Supermart.product_info('orange')
Supermart.product_info('banana')

예제 #11
0
from store import Store
from product import Product

target = Store("Target")

milk = Product("milk", 1, "food")
egg = Product("egg", 2, "food")
camera = Product("camera", 100, "tech")
chair = Product("chair", 30, "furniture")
table = Product("table", 200, "furniture")

target.add_product(milk)
target.add_product(egg)
target.add_product(camera)
target.add_product(chair)
target.add_product(table)

target.sell_product(2)

target.inflation(0.2)

target.sell_product(0)

target.product_list[1].print_info()
target.set_clearance("furniture", 0.5)

target.sell_product(1)
target.sell_product(1)
예제 #12
0
from products import Product
from store import Store


Store1 = Store("Academy Sports")
Store1.add_product( Product("Hoodie", 50, "Apparel") )
Store1.add_product( Product("Nike Shox", 100, "Shoes") )
Store1.add_product( Product("Mizuno", 1200, "Golf Clubs") )

for i in range(0, len(Store1.products), 1):
    print(Store1.products[i].name)
    print(Store1.products[i].category)
    print(Store1.products[i].price)
    print()

Store1.sell_product(0)

print("-------------------------------------------------------------")

for i in range(0, len(Store1.products), 1):
    print(Store1.products[i].name)
    print(Store1.products[i].category)
    print(Store1.products[i].price)
    print()
예제 #13
0
from store import Store
from products import Product



hat = Product("baseball_hat",10,"spring")
shirt = Product("t_shirt",20,"casual")
sock = Product("thermal_sock",5,"winter")
store = Store("Clothing Store")
store.add_product(hat).add_product(shirt).add_product(sock)

store.set_clearance("casual",10) 
store.display_products()

예제 #14
0
from products import Product
from store import Store

orange = Product("Oranges", 5, "Fruit")
apple = Product("Apple", 4, "Fruit")
melon = Product("Watermelon", 3, "Fruit")
peanut = Product("Peanuts", 1.20, "Nuts")
cashew = Product("Cashews", 1.40, "Nuts")
wallymart = Store("Wallymart")
wallymart.add_product(apple).add_product(orange).add_product(
    melon).add_product(peanut).add_product(cashew)


def print_full_store():
    print("-" * 35)
    print("-" * 35)
    print(wallymart.name)

    for i in range(len(wallymart.productList)):
        print("-" * 25)
        wallymart.productList[i].print_info()


print_full_store()
wallymart.inflation(.25)
print_full_store()
wallymart.set_clearance("Fruit", .5)
print_full_store()
wallymart.sell_product(orange.id)
wallymart.sell_product(apple.id)
wallymart.sell_product(melon.id)
예제 #15
0
from product import Product
from store import Store

# name, price, weight, brand, cost

teddy_bear = Product("Teddy Bear", 20, .5, "FAO Schwartz", 2)
toy_soldiers = Product("Toy Soldiers", 1, .1, "Uncle Sam", .05)
nerf_gun = Product("Nerf Gun", 25, 2, "Nerf", 2.5)

myStore = Store("800 Imaginary Ave", "Stephen Weil")
print "Adding Three Toys and Displaying Inventory"
print "************"
myStore.info().add_product(teddy_bear).add_product(toy_soldiers).add_product(nerf_gun).inventory()
print "Sell Teddy Bear and Display It's Info"
print "************"
teddy_bear.sell().display_info()
print "Removing Teddy Bear and Displaying Inventory"
print "************"
myStore.remove_product(teddy_bear).inventory()
print "Taking Back Teddy Bear and Displaying Teddy Bear Info"
print "************"
teddy_bear.take_back('used').display_info()
print "Now Displaying Inventory With Teddy Bear"
print "************"
myStore.add_product(teddy_bear).inventory()
예제 #16
0
from store import Store
from product import Product

s1 = Store("Lynnwood", "Li")
s1.add_product(Product("banana", 10, "1 lb", "sun"))
s1.add_product(Product("watermelon", 3, "1.5 lb", "west"))
s1.inventory()
print s1
예제 #17
0
from store import Store
from product import Product

amazon = Store(name="Amazon")

cell_phone = Product(name="Cellular Phone", price=500, category='Electronics')
table = Product(name="Table", price=1200, category='Furniture')
rug = Product(name="Rug", price=200, category='Electronics')

amazon.add_product(cell_phone).add_product(table).add_product(
    rug).sell_product(2)

for prod in amazon.products:
    print(prod.name, prod.price, prod.category)
from product import Product
from store import Store

Product1 = Product(20, "Toddler shoes", 1, "Carter's", "for sale")
Product2 = Product(10, "Toddler socks", 1, "Carter's", "for sale")
Product1.sell()
Product2.sell()
Product2.return_product("used")

Store1 = Store([Product1, Product2], "Redmond", "Stephanie Artati")
Product3 = Product(25, "Toddler sleepsack", 2, "Gymboree", "for sale")
Store1.add_product(Product3)
Store1.inventory()

Store1.remove_product("Toddler socks")
Store1.inventory()
예제 #19
0
prod1 = Product("TV", 700, 20)
prod2 = Product("SmartPhone", 250, 2)
prod3 = Product("Toaster", 45, 5)


def add_product(self):
    Store.products.append({
        "product_name": Product.name,
        "price": Product.price,
        "weight": Product.weight
    })
    return self


print Store1.add_product(prod1)

# Store1.add_product(prod1)

#     def remove_product(self, product_name):
#         for product in self.products:
#             if product['product_name'] == product_name:
#                 self.products.remove(product)
#                 return self

#     def inventory(self):
#         print "Store location: " + self.location
#         print "Owner: " + self.owner
#         for product in self.products:
#             print "Product: " + product['product_name'] +", Price: " + str(product['price']) + ", Weight: " + str(product['weight'])
#         print "*"*10
예제 #20
0
from product import Product
from store import Store

# walMart.inflation(0.05)
potato = Product(1, "Potato", 2, "Vegetable")
# potato.update_price(0.05, True).print_info()
carrot = Product(2, "Carrot", 1.5, "Vegetable")
onion = Product(3, "Onion", 1, "Vegetable")
coke = Product(4, "Coke", 3, "Drink")
pepsi = Product(5, "Pepsi", 2.8, "Drink")
chips = Product(6, "Chips", 3, "Snack")
cake = Product(7, "Cake", 3, "Snack")
candy = Product(8, "Candy", 3, "Snack")

walMart = Store('Wal Mart')
walMart.add_product(potato)
walMart.add_product(carrot)
walMart.add_product(onion)
walMart.add_product(coke)
walMart.add_product(pepsi)
walMart.add_product(chips)
walMart.add_product(cake)
walMart.add_product(candy)
walMart.sell_product(6)
# print(walMart.products)
# walMart.set_clearance("Vegetable", 0.05)

# class Store:
#     def __init__(self, name):
#         self.name = name
#         self.products = []
예제 #21
0
from store import Store
from products import Product

Coops = Store(name="Coops")

skates = Product('Skates', 800, 'Hockey')
stick = Product('Stick', 300, 'Hockey')

Coops.add_product(skates)
Coops.add_product(stick)

skates.print_info()
stick.print_info()

# Coops.sell_product(0)

Coops.set_clearance('Hockey', .50)
print('*' * 50)
skates.print_info()
stick.print_info()
Stores = []
walmart = Store("Walmart")
Stores.append(walmart)
safeway = Store("Safeway")
Stores.append(safeway)

Products = []
milk = Product("Milk", 4.99, "Dairy")
Products.append(milk)
eggs = Product("Eggs", 2.95, "Dairy")
Products.append(eggs)
gfBread = Product("Gluten-Free Bread", 7.50, "Grains")
Products.append(gfBread)

milk.update_price(5, True)
milk.print_info()

gfBread.print_info()

safeway.add_product(gfBread).add_product(eggs).add_product(eggs).add_product(eggs).add_product(eggs)

safeway.sell_product(1)

safeway.inflation(2)

printAllInfo()

safeway.set_clearance("Grains", 5)

printAllInfo()
예제 #23
0
from store import Store
from product import Product

p = Product(9.99, "shoe", "1lbs", "mike", 5.99)
b = Product(10.25, "pants", "100lbs", "test_brand", 1123.12)
p.addTax(.2).sell().returnProduct("defective")

s = Store([
    Product(9.99, "shoe", "1lbs", "mike", 5.99),
    Product(10.25, "pants", "100lbs", "test_brand", 1123.12)
], "Bellevue", "Alex")

s.add_product(Product(20.5, "jacket", "20lbs", "another_test_brand", 2))
print "first inventory"
s.inventory()
print "second inventory"
s.remove_product("shoe").inventory()
예제 #24
0
from store import Store

store = Store("Seattle","Kristin")

product1 = store.add_product(2300,"Fast Fancy Bike",10,"Trek")
product2 = store.add_product(300,"Gold Paperclip",2,"Clippy")
product3 = store.add_product(1,"Broken Water bottle",1,"REI")
store.inventory()
print "\n"
product1.return_product("defective")
product2.return_product("opened")
product3.return_product("in the box, like new")
store.inventory()
print "\n"
store.remove_product("Fast Fancy Bike")
store.inventory()
print "\n"
store.add_product(3000,"MacBook",3,"Apple")
store.inventory()
print "\n"

print store
예제 #25
0
from store import Store
from product import Product

item1 = Product(3.99, "ketchup", "38oz", "Heinz", 3.00)
item2 = Product(1.97, "Mustard", "20oz", "French's", 1.26)
item3 = Product(3.12, "Relish", "26oz", "Heinz", 2.66)

store1 = Store("Thomas Tarkington", "Dallas, TX")
store2 = Store("Staci R", "Grand Prarire, TX")

print "*********************"
store1.add_product(item1).add_product(item2).inventory()
print "*********************"
store1.remove_product("ketchup").add_product(item3).inventory()
예제 #26
0
파일: runner.py 프로젝트: MohGanji/quera
from store import Store
from models import Product, User

s = Store()
p = Product(name="something", price=12, category="thing")
s.add_product('something', 2)
print(s.get_total_asset())