Initial commit

This commit is contained in:
BarsTigerMeowcat
2020-01-26 12:49:01 +02:00
commit 8bed7171c2
125 changed files with 3212 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
class Bird(object):
def __init__(self, name, wingspan):
self.name = name
self.wingspan = wingspan
def birdcall(self):
print("чик-чирик")
def fly(self):
print("хлоп-хлоп")
class Penguin(Bird):
def swim(self):
print("умеет плавать")
def birdcall(self):
print("квак")
def fly(self):
print("пингвины не летают :(")
class Parrot(Bird):
def __init__(self, name, wingspan, color):
self.name = name
self.wingspan = wingspan
self.color = color
gardenBird = Bird("Geoffrey", 12)
gardenBird.birdcall()
gardenBird.fly()
sarahThePenguin = Penguin("Sarah", 10)
sarahThePenguin.swim()
sarahThePenguin.fly()
sarahThePenguin.birdcall()
freddieTheParrot = Parrot("Freddie", 12, "синий")
print(freddieTheParrot.color)
freddieTheParrot.fly()
freddieTheParrot.birdcall()