{"id":753,"date":"2024-04-15T21:17:27","date_gmt":"2024-04-15T21:17:27","guid":{"rendered":"https:\/\/javigomez.org\/?p=753"},"modified":"2025-09-29T20:32:51","modified_gmt":"2025-09-29T20:32:51","slug":"06-10-python-clases-clases-abstractas","status":"publish","type":"post","link":"https:\/\/javigomez.org\/index.php\/2024\/04\/15\/06-10-python-clases-clases-abstractas\/","title":{"rendered":"06.10 Python \u2013 Clases \u2013 Clases abstractas"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>from abc import ABC, abstractmethod\n\nclass Figura(ABC):\n    @abstractmethod\n    def area(self):\n        pass\n\n    @abstractmethod\n    def perimetro(self):\n        pass\n\nclass Cuadrado(Figura):\n    def __init__(self,lado):\n        self.lado=lado\n\n    def area(self):\n        return(self.lado*self.lado)\n\n    def perimetro(self):\n        return(4*self.lado)\n\n\nc=Cuadrado(5)\nprint(c.area())\nprint(c.perimetro())\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-4-3 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"PYTHON U06 10 Clases abstractas\" width=\"1200\" height=\"900\" src=\"https:\/\/www.youtube.com\/embed\/-dwgFR7tYrs?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[79,80,277],"class_list":["post-753","post","type-post","status-publish","format-standard","hentry","category-python","tag-clases","tag-clases-abstractas","tag-python"],"_links":{"self":[{"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/posts\/753","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/comments?post=753"}],"version-history":[{"count":1,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/posts\/753\/revisions"}],"predecessor-version":[{"id":853,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/posts\/753\/revisions\/853"}],"wp:attachment":[{"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/media?parent=753"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/categories?post=753"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/tags?post=753"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}