Advertisement
molendzik

Programowanie obiektowe - zadanie 1

Mar 2nd, 2020
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. class Pilkarz():
  2.   pass
  3.  
  4. class PilkarzNozny(Pilkarz):
  5.   def StrzelGola(self):
  6.     print ('Piłkarz Nożny strzelił gola')
  7.  
  8.  
  9. class PilkarzReczny(Pilkarz):
  10.   def StrzelGola(self):
  11.     print ('Piłkarz Ręczny strzelił gola')
  12.  
  13. def StrzelGola(gracz):
  14.   gracz.StrzelGola()
  15.  
  16. PN = PilkarzNozny()
  17. PR = PilkarzReczny()
  18.  
  19. StrzelGola(PN)
  20. StrzelGola(PR)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement