Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class zwierze:
- imie = None
- opis = None
- iloscn = None
- class pies(zwierze):
- rasa = None
- waga = None
- class ptak(zwierze):
- kolor = None
- waga = None
- class pajak(zwierze):
- kolor = None
- waga = None
- def main():
- dog = pies()
- dog.imie = "as"
- dog.opis = "ALa ma doga"
- dog.iloscn = 4.0
- dog.waga = 24.0
- dog.rasa = "dog"
- jamnik = pies()
- jamnik.imie = "asik"
- jamnik.opis = "ALa ma jamnika"
- jamnik.iloscn = 4.0
- jamnik.waga = 19.0
- jamnik.rasa = "jamnik"
- kanarek = ptak()
- kanarek.imie = "kanarek"
- kanarek.opis = "Ala ma kanarka"
- kanarek.iloscn = 2.0
- kanarek.waga = 2.0
- kanarek.kolor = "czerwony"
- papuga = ptak()
- papuga.imie = "papuszka"
- papuga.opis = "Ala ma papuge"
- papuga.iloscn = 2.0
- papuga.waga = 4.0
- papuga.kolor = "niebieski"
- pajaczek = pajak()
- pajaczek.imie = "pajak"
- pajaczek.opis = "Ala ma pajaka"
- pajaczek.iloscn = 6.0
- pajaczek.waga = 0.3
- pajaczek.kolor = "czarny"
- print("Zwierze 1: " + dog.imie + " " + dog.opis + " " + str(dog.iloscn) + " " + str(dog.waga) + " " + dog.rasa)
- print("Zwierze 2: " + jamnik.imie + " " + jamnik.opis + " " + str(jamnik.iloscn) + " " + str(jamnik.waga) + " " + jamnik.rasa)
- print("Zwierze 3: " + kanarek.imie + " " + kanarek.opis + " " + str(kanarek.iloscn) + " " + str(kanarek.waga) + " " + kanarek.kolor)
- print("Zwierze 4: " + papuga.imie + " " + papuga.opis + " " + str(papuga.iloscn) + " " + str(papuga.waga) + " " + papuga.kolor)
- print("Zwierze 5: " + pajaczek.imie + " " + pajaczek.opis + " " + str(pajaczek.iloscn) + " " + str(pajaczek.waga) + " " + pajaczek.kolor)
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement