trida_str.py 228 Bytes
Newer Older
Martin Mareš's avatar
Objekty  
Martin Mareš committed
1
2
3
4
5
6
7
8
9
class Zvire:
    def __init__(self, jmeno, zvuk):
        self.jmeno = jmeno
        self.zvuk = zvuk

    def __str__(self):
        return self.jmeno

    def __repr__(self):
Martin Mareš's avatar
Martin Mareš committed
10
        return f"Zvire({self.jmeno}, {self.zvuk})"