{"id":735,"date":"2024-04-14T11:03:45","date_gmt":"2024-04-14T11:03:45","guid":{"rendered":"https:\/\/javigomez.org\/?p=735"},"modified":"2025-09-29T20:33:15","modified_gmt":"2025-09-29T20:33:15","slug":"06-03-python-clases-atributos-como-tupla-o-diccionario","status":"publish","type":"post","link":"https:\/\/javigomez.org\/index.php\/2024\/04\/14\/06-03-python-clases-atributos-como-tupla-o-diccionario\/","title":{"rendered":"06.03 Python \u2013 Clases &#8211; atributos como tupla o diccionario"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>class Persona:\n    def __init__(self, nombre, edad, *args,**kwargs):\n        self.nombre=nombre\n        self.edad=edad\n        self.valores=args\n        self.dic=kwargs\n\n    def __str__(self):\n        return f\"Nombre: {self.nombre} edad: {self.edad} valores: {self.valores} Dic: {self.dic}\"\n\n\n\np = Persona(\"Javi\",56,1,2,3,4,5,m=\"manzana\",p=\"pera\")\n\nprint(p.nombre)\nprint(p.edad)\nprint(p.valores)\nprint(p.dic)\n\nprint(p)\n\nprint(p.valores&#91;4])\nprint(p.dic&#91;'p'])\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 03 Clases tupla dic\" width=\"1200\" height=\"900\" src=\"https:\/\/www.youtube.com\/embed\/IbKC0gBjvlY?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,118,277,335],"class_list":["post-735","post","type-post","status-publish","format-standard","hentry","category-python","tag-clases","tag-diccionario","tag-python","tag-tupla"],"_links":{"self":[{"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/posts\/735","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=735"}],"version-history":[{"count":1,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/posts\/735\/revisions"}],"predecessor-version":[{"id":860,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/posts\/735\/revisions\/860"}],"wp:attachment":[{"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/media?parent=735"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/categories?post=735"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/tags?post=735"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}