{"id":10860,"date":"2014-12-12T16:25:41","date_gmt":"2014-12-12T21:25:41","guid":{"rendered":"http:\/\/blog.espol.edu.ec\/ccpg1001\/?p=10860"},"modified":"2026-04-05T18:41:15","modified_gmt":"2026-04-05T23:41:15","slug":"s3eva2012ti_t2-validar-infix-y-convertir-a-prefix","status":"publish","type":"post","link":"https:\/\/blog.espol.edu.ec\/algoritmos101\/fp-s3eva20\/s3eva2012ti_t2-validar-infix-y-convertir-a-prefix\/","title":{"rendered":"s3Eva2012TI_T2 Validar infix y convertir a prefix"},"content":{"rendered":"\n<p><strong>Ejercicio<\/strong>: <a href=\"https:\/\/blog.espol.edu.ec\/algoritmos101\/fp-3eva20\/3eva2012ti_t2-validar-infix-y-convertir-a-prefix\/\" data-type=\"post\" data-id=\"2631\">3Eva2012TI_T2 Validar infix y convertir a prefix<\/a><\/p>\n\n\n\n<p>resultados obtenidos,<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&gt;&gt;&gt; in2prefix('2+3')\n'+ 2 3'\n&gt;&gt;&gt; validainfix('2+3')\nTrue\n&gt;&gt;&gt; validainfix('23+')\nFalse\n&gt;&gt;&gt; in2prefix('2+3')\n'+ 2 3'\n&gt;&gt;&gt; <\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Algoritmo en Python<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n# 3Eva_IT2012_T2 Validar infix y convertir a prefix\n\ndef validainfix(cadena):\n    numero ='0123456789'\n    operador ='+-'\n    c1 = cadena&#x5B;0] in numero\n    c2 = cadena&#x5B;2] in numero\n    c3 = cadena&#x5B;1] in operador\n\n    z = 'use 3 d\u00edgitos'\n    if len(cadena)==3:\n        z = c1 and c2 and c3\n    return(z)\n\ndef in2prefix(cadena):\n    z = 'use 3 d\u00edgitos'\n    condicion = validainfix(cadena)\n    if len(cadena)==3 and condicion:\n        z = cadena&#x5B;1]\n        z = z+' '+cadena&#x5B;0]\n        z = z+' '+cadena&#x5B;2]\n    return(z)\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>Ejercicio: 3Eva2012TI_T2 Validar infix y convertir a prefix resultados obtenidos, Algoritmo en Python<\/p>\n","protected":false},"author":8043,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"wp-custom-template-entrada-fp-ejemplos","format":"standard","meta":{"footnotes":""},"categories":[143],"tags":[58,157],"class_list":["post-10860","post","type-post","status-publish","format-standard","hentry","category-fp-s3eva20","tag-ejemplos-python","tag-fundamentos-programacion"],"_links":{"self":[{"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/posts\/10860","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/users\/8043"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/comments?post=10860"}],"version-history":[{"count":4,"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/posts\/10860\/revisions"}],"predecessor-version":[{"id":23781,"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/posts\/10860\/revisions\/23781"}],"wp:attachment":[{"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/media?parent=10860"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/categories?post=10860"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/tags?post=10860"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}