{"id":35448,"date":"2025-03-26T11:46:24","date_gmt":"2025-03-26T11:46:24","guid":{"rendered":"https:\/\/www.deltapci.com\/?p=35448"},"modified":"2025-03-26T11:46:24","modified_gmt":"2025-03-26T11:46:24","slug":"ejercicios-de-listas-en-python","status":"publish","type":"post","link":"https:\/\/recursing-dhawan.212-132-71-197.plesk.page\/index.php\/2025\/03\/26\/ejercicios-de-listas-en-python\/","title":{"rendered":"Ejercicios de Listas en Python"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Ejercicio 1: Sublistas con suma objetivo<\/h4>\n\n\n\n<p>Descripci\u00f3n: Dada una lista de n\u00fameros y una suma objetivo, crea sublistas de tama\u00f1o creciente hasta que la suma de los elementos alcance o supere el objetivo. Devuelve las sublistas y la cantidad total sumada.<\/p>\n\n\n\n<iframe loading=\"lazy\" src=\"https:\/\/trinket.io\/embed\/python\/15cfa4c71170\" width=\"100%\" height=\"600\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" allowfullscreen><\/iframe>\n\n\n\n<h4 class=\"wp-block-heading\">Ejercicio 2 Diccionario de frecuencias con listas anidadas<\/h4>\n\n\n\n<p>Descripci\u00f3n: Dada una lista de listas, crea un diccionario que cuente la frecuencia de cada elemento \u00fanico, ignorando la estructura anidada.<\/p>\n\n\n\n<iframe loading=\"lazy\" src=\"https:\/\/trinket.io\/embed\/python\/49321ea35c08\" width=\"100%\" height=\"600\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" allowfullscreen><\/iframe>\n\n\n\n<h5 class=\"wp-block-heading\">Ejercicio 3: Validaci\u00f3n de etiquetas HTML<\/h5>\n\n\n\n<p>Descripci\u00f3n: Escribe una funci\u00f3n que verifique si una secuencia de etiquetas HTML est\u00e1 correctamente anidada y cerrada usando una pila. Considera solo etiquetas de apertura (&lt;tag&gt;) y cierre (&lt;\/tag&gt;), ignorando contenido entre ellas.<\/p>\n\n\n\n<p>Ejemplo:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Entrada: \u00ab&lt;div>&lt;p>&lt;span>&lt;\/span>&lt;\/p>&lt;\/div>\u00bb<\/li>\n\n\n\n<li>Salida: True<\/li>\n\n\n\n<li>Entrada: \u00ab&lt;div>&lt;p>&lt;\/div>&lt;\/p>\u00bb<\/li>\n\n\n\n<li>Salida: False<\/li>\n<\/ul>\n\n\n\n<iframe loading=\"lazy\" src=\"https:\/\/trinket.io\/embed\/python\/0fb8356eac85\" width=\"100%\" height=\"600\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" allowfullscreen><\/iframe>\n\n\n\n<h5 class=\"wp-block-heading\">Ejercicio 4: Secuencia de pulsaciones m\u00ednimas<\/h5>\n\n\n\n<p>Descripci\u00f3n: Dada una cadena con &lt; (retroceso) y caracteres normales, usa una pila para determinar la cadena resultante despu\u00e9s de procesar todas las pulsaciones, como si se escribiera en un editor.<\/p>\n\n\n\n<p>Ejemplo:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Entrada: \u00aba&lt;&lt;bc\u00bb<\/li>\n\n\n\n<li>Salida: \u00abbc\u00bb<\/li>\n\n\n\n<li>Entrada: \u00abab&lt;c&lt;d\u00bb<\/li>\n\n\n\n<li>Salida: \u00abad\u00bb<\/li>\n<\/ul>\n\n\n\n\n\n<iframe loading=\"lazy\" src=\"https:\/\/trinket.io\/embed\/python\/03279e9ab227\" width=\"100%\" height=\"600\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" allowfullscreen><\/iframe>\n","protected":false},"excerpt":{"rendered":"<p>Ejercicio 1: Sublistas con suma objetivo Descripci\u00f3n: Dada una lista de n\u00fameros y una suma objetivo, crea sublistas de tama\u00f1o [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"footnotes":""},"categories":[2],"tags":[],"class_list":["post-35448","post","type-post","status-publish","format-standard","hentry","category-tutoriales"],"_links":{"self":[{"href":"https:\/\/recursing-dhawan.212-132-71-197.plesk.page\/index.php\/wp-json\/wp\/v2\/posts\/35448","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/recursing-dhawan.212-132-71-197.plesk.page\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/recursing-dhawan.212-132-71-197.plesk.page\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/recursing-dhawan.212-132-71-197.plesk.page\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/recursing-dhawan.212-132-71-197.plesk.page\/index.php\/wp-json\/wp\/v2\/comments?post=35448"}],"version-history":[{"count":0,"href":"https:\/\/recursing-dhawan.212-132-71-197.plesk.page\/index.php\/wp-json\/wp\/v2\/posts\/35448\/revisions"}],"wp:attachment":[{"href":"https:\/\/recursing-dhawan.212-132-71-197.plesk.page\/index.php\/wp-json\/wp\/v2\/media?parent=35448"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/recursing-dhawan.212-132-71-197.plesk.page\/index.php\/wp-json\/wp\/v2\/categories?post=35448"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/recursing-dhawan.212-132-71-197.plesk.page\/index.php\/wp-json\/wp\/v2\/tags?post=35448"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}