What is the full traceback of your error? Without that we are just guessing
this is not a legit comment
You only need
You are redefining
and your method is misaligned:
this is not a legit comment
Quote:'#' # Create Products
You only need
# Create Productsyou import product (lowercase) but use it uppercased
Quote:from product import product ... Product.create_products()
You are redefining
product
on line 45and your method is misaligned:
class Product(object): products = [] def __init__(self, name, minprice, maxprice): self.name = name self.minprice = minprice self.maxprice = maxprice self.price = random.randint(self.minprice,self.maxprice) @classmethod def create_products(cls): cls.products.append(Product("General Goods", 3, 20)) cls.products.append(Product("Arms", 3, 20))
Recommended Tutorials: