Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: d6dab77f2b
Fetching contributors…

Cannot retrieve contributors at this time

38 lines (21 sloc) 0.589 kb
#!/usr/bin/env python
class Products(object):
'''def setProduct(self, name, price, toys):
self.price = price
self.name = name '''
def getProduct(self):
print "%s: $%s" % (self.name, self.price)
def __init__(self, name, price):
self.price = price
self.name = name
def __str__(self):
return self.name
def __repr__(self):
return self.name
class Cereal(Products):
def __init__(self, name, price, toy):
self.Toy = toy
#super(Cereal,self).__init__(name,price)
'''def addToy(self, Toy):
self.toy = Toy'''
c1 = Cereal("capt crunch", "4.95", "Whistle")
Jump to Line
Something went wrong with that request. Please try again.