fork(1) download
  1. class Base(object):
  2. def get_value(self):
  3. print("This is the derived value:", self.value)
  4.  
  5. class Derived(Base):
  6. def __init__(self, value):
  7. self.value = value
  8.  
  9. d = Derived(5)
  10. d.get_value() # prints "This is the derived value: 5"
Success #stdin #stdout 0.04s 9296KB
stdin
Standard input is empty
stdout
This is the derived value: 5