{"id":8122,"date":"2014-08-06T20:10:03","date_gmt":"2014-08-07T01:10:03","guid":{"rendered":"http:\/\/blog.espol.edu.ec\/ccpg1001\/?p=8122"},"modified":"2026-04-05T18:27:18","modified_gmt":"2026-04-05T23:27:18","slug":"s3eva2003tiii_t4-informes-notas-de-estudiantes","status":"publish","type":"post","link":"https:\/\/blog.espol.edu.ec\/algoritmos101\/fp-s3eva10\/s3eva2003tiii_t4-informes-notas-de-estudiantes\/","title":{"rendered":"s3Eva2003TIII_T4 Informes notas de estudiantes"},"content":{"rendered":"\n<p><em><strong>Ejercicio<\/strong><\/em>: <a href=\"https:\/\/blog.espol.edu.ec\/algoritmos101\/fp-3eva10\/3eva2003tiii_t4-informes-notas-de-estudiantes\/\" data-type=\"post\" data-id=\"2510\">3Eva2003TIII_T4 Informes notas de estudiantes<\/a><\/p>\n\n\n\n<p>Propuesta de soluci\u00f3n en <strong>Python<\/strong>:<\/p>\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_IIIT2003_T4 Informes notas de estudiantes\n\n# INGRESO\nestudiantes = &#x5B;]\nn = int(input('cupo: '))\ni = 0\nwhile not(i&gt;=n):\n    nom = input('nombre: ')\n    eda = int(input('edad: '))\n    gen = input(' genero m\/f: ')\n    while not(gen=='f' or gen=='m'):\n        print(' genero f o m ')\n        gen = input('genero: ')\n    \n    par = int(input('parcial: '))\n    while not(par&gt;=0 and par&lt;=100):\n        print(' nota son &#x5B;0,100] ')\n        par = int(input('parcial: '))\n        \n    fin = int(input('final: '))\n    while not(fin&gt;=0 and fin&lt;=100):\n        print(' nota son &#x5B;0,100] ')\n        fin = int(input('final: '))\n        \n    registro = {'nombre':nom,\n                'edad':eda,\n                'genero':gen,\n                'parcial':par,\n                'final':fin}\n    estudiantes.append(registro)\n    i = i+1\n\n# ingresa sin extension '.txt'\nnarchivo = input('nombre del archivo: ')\nnarchivo = narchivo + '.txt'\n\n# PROCEDIMIENTO\n# Guarda el archivo con datos estudiantes\nn =  len(estudiantes)\narchivo = open(narchivo, 'w')\ni = 0\nwhile not(i&gt;=n):\n    nom = estudiantes&#x5B;i]&#x5B;'nombre']\n    eda = estudiantes&#x5B;i]&#x5B;'edad']\n    gen = estudiantes&#x5B;i]&#x5B;'genero']\n    par = estudiantes&#x5B;i]&#x5B;'parcial']\n    fin = estudiantes&#x5B;i]&#x5B;'final']\n    linea = nom +','+str(eda)+','+gen\n    linea = linea + ',' + str(par)\n    linea = linea + ',' + str(fin) + '\\n'\n    archivo.write(linea)\n    i = i + 1\n\narchivo.close()\n\n# SALIDA\nprint(estudiantes)\n<\/pre><\/div>\n\n\n<p>resultado del algoritmo<\/p>\n\n\n\n<pre class=\"wp-block-code alignwide\"><code>upo: 5\nnombre: Juan\nedad: 19\n genero m\/f: m\nparcial: 65\nfinal: 40\nnombre: Maria\nedad: 18\n genero m\/f: f\nparcial: 70\nfinal: 80\nnombre: Ana\nedad: 19\n genero m\/f: f\nparcial: 90\nfinal: 92\nnombre: Juan\nedad: 20\n genero m\/f: m\nparcial: 40\nfinal: 80\nnombre: Rosa\nedad: 18\n genero m\/f: f\nparcial: 80\nfinal: 85\nnombre del archivo: calificaciones\n&#091;{'nombre': 'Juan', 'edad': 19, 'genero': 'm',\n  'parcial': 65, 'final': 40},\n {'nombre': 'Maria', 'edad': 18, 'genero': 'f',\n  'parcial': 70, 'final': 80},\n {'nombre': 'Ana', 'edad': 19, 'genero': 'f',\n  'parcial': 90, 'final': 92},\n {'nombre': 'Juan', 'edad': 20, 'genero': 'm',\n  'parcial': 40, 'final': 80},\n {'nombre': 'Rosa', 'edad': 18, 'genero': 'f',\n  'parcial': 80, 'final': 85}]\n&gt;&gt;&gt; <\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Ejercicio: 3Eva2003TIII_T4 Informes notas de estudiantes Propuesta de soluci\u00f3n 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-8122","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\/8122","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=8122"}],"version-history":[{"count":3,"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/posts\/8122\/revisions"}],"predecessor-version":[{"id":23742,"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/posts\/8122\/revisions\/23742"}],"wp:attachment":[{"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/media?parent=8122"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/categories?post=8122"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/tags?post=8122"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}