{"id":4136,"date":"2014-10-02T15:55:08","date_gmt":"2014-10-02T20:55:08","guid":{"rendered":"http:\/\/blog.espol.edu.ec\/icm00794\/?p=4136"},"modified":"2026-04-05T18:23:09","modified_gmt":"2026-04-05T23:23:09","slug":"s3eva2007tii_t1-depreciacion-por-suma-de-digitos","status":"publish","type":"post","link":"https:\/\/blog.espol.edu.ec\/algoritmos101\/fp-s3eva10\/s3eva2007tii_t1-depreciacion-por-suma-de-digitos\/","title":{"rendered":"s3Eva2007TII_T1 Depreciaci\u00f3n por suma de d\u00edgitos"},"content":{"rendered":"\n<p><em><strong>Ejercicio<\/strong><\/em>: <a href=\"https:\/\/blog.espol.edu.ec\/algoritmos101\/fp-3eva10\/3eva2007tii_t1-depreciacion-por-suma-de-digitos\/\" data-type=\"post\" data-id=\"2563\">3Eva2007TII_T1 Depreciaci\u00f3n por suma de d\u00edgitos<\/a><\/p>\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# ICM00794-Fundamentos de Computaci\u00f3n - FCNM-ESPOL\n# 3Eva_IIT2007_T1 Depreciaci\u00f3n por suma de d\u00edgitos\nimport numpy as np\n\narticulo = input('nombre articulo: ')\nanios = int(input('a\u00f1os a depreciar: '))\nvalor = float(input('valor inicial: '))\n\n# PROCEDIMIENTO\nsuma = 0\ncontador = anios\nwhile not(contador&lt;1):\n    suma = suma+contador\n    contador = contador-1\n\n# vector depreciacion\ndeprecia = np.zeros(anios+1, dtype=float)\ndeprecia&#x5B;0] = 0\ncontador = anios\nfila = 1\nwhile not(contador&lt;1):\n    deprecia&#x5B;fila] = valor*(contador\/suma)\n    contador = contador-1\n    fila = fila+1\n\nactual = np.zeros(anios+1,dtype=float)\nfila = 0\nactual&#x5B;0] = valor\nfila = 1\nwhile not(fila&gt;anios):\n    actual&#x5B;fila] = actual&#x5B;fila-1]-deprecia&#x5B;fila]\n    fila = fila+1\n    \nprint(deprecia)\nprint(' El valor actual por anio es:')\n\n# SALIDA\nfila = 0\nprint(' anio:   valor:')\nwhile not(fila&gt;anios):\n    print(str(fila)+' | '+str(actual&#x5B;fila]))\n    fila = fila+1\n<\/pre><\/div>\n\n\n<p>resultado del algoritmo<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nombre articulo: vehiculo\na\u00f1os a depreciar: 5\nvalor inicial: 10000\n&#091;   0.  3333.33333333 2666.66666667  2000.  1333.33333333\n  666.66666667]\n El valor actual por anio es:\n anio:   valor:\n0 | 10000.0\n1 | 6666.666666666667\n2 | 4000.0000000000005\n3 | 2000.0000000000005\n4 | 666.6666666666672\n5 | 5.684341886080801e-13\n&gt;&gt;&gt; <\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Ejercicio: 3Eva2007TII_T1 Depreciaci\u00f3n por suma de d\u00edgitos Algoritmo en Python resultado del algoritmo<\/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":[138],"tags":[58,157],"class_list":["post-4136","post","type-post","status-publish","format-standard","hentry","category-fp-s3eva10","tag-ejemplos-python","tag-fundamentos-programacion"],"_links":{"self":[{"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/posts\/4136","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=4136"}],"version-history":[{"count":4,"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/posts\/4136\/revisions"}],"predecessor-version":[{"id":23727,"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/posts\/4136\/revisions\/23727"}],"wp:attachment":[{"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/media?parent=4136"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/categories?post=4136"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/tags?post=4136"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}