class fixa: barva = "" def pis(self): print("Pisu {}.".format(self.barva)) def __init__(self, barva=""): self.barva = barva def __str__(self): return("Fixa pisici {}.".format(self.barva)) fixa1 = fixa() fixa1.barva = "cervene" fixa1.pis() print(fixa1) # print(str(fixa1)) fixa3 = fixa() fixa3.barva = "modre" fixa3.pis() fixa2 = fixa("zelene") fixa2.pis()