from random import randint
class Square(object):
name = "Kvadrat"
side = 0
def side_a(self):
self.side = randint(1,10)
return self.side
def area(self):
return self.side_a() ** 2
def random_text(self):
return "Side: %d, area: %d" % (self.side, self.area())
s = Square()
print(s.random_text())
print(s.random_text())
print(s.random_text())
print(s.random_text())
ZnJvbSByYW5kb20gaW1wb3J0IHJhbmRpbnQKCmNsYXNzIFNxdWFyZShvYmplY3QpOgoJbmFtZSA9ICJLdmFkcmF0IgoJc2lkZSA9IDAKCQoJZGVmIHNpZGVfYShzZWxmKToKCQlzZWxmLnNpZGUgPSByYW5kaW50KDEsMTApCgkJcmV0dXJuIHNlbGYuc2lkZQoJCglkZWYgYXJlYShzZWxmKToKCQlyZXR1cm4gc2VsZi5zaWRlX2EoKSAqKiAyCgkKCWRlZiByYW5kb21fdGV4dChzZWxmKToKCQlyZXR1cm4gIlNpZGU6ICVkLCBhcmVhOiAlZCIgJSAoc2VsZi5zaWRlLCBzZWxmLmFyZWEoKSkKCnMgPSBTcXVhcmUoKQpwcmludChzLnJhbmRvbV90ZXh0KCkpCnByaW50KHMucmFuZG9tX3RleHQoKSkKcHJpbnQocy5yYW5kb21fdGV4dCgpKQpwcmludChzLnJhbmRvbV90ZXh0KCkp