examen 1

parent 3b5c1109
...@@ -499,19 +499,17 @@ ...@@ -499,19 +499,17 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 319, "execution_count": 324,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"Solo se leer del 1 al 3999\n",
"Ingresar número (Cero para terminar el programa):10\n", "Ingresar número (Cero para terminar el programa):10\n",
"10:\n", "10:\n",
"X\n", "X\n",
"Ingresar número (Cero para terminar el programa):24\n",
"24:\n",
"XXIV\n",
"Ingresar número (Cero para terminar el programa):0\n" "Ingresar número (Cero para terminar el programa):0\n"
] ]
} }
...@@ -519,8 +517,14 @@ ...@@ -519,8 +517,14 @@
"source": [ "source": [
"enteros= [1000, 900, 500, 400,100, 90, 50, 40,10, 9, 5, 4,1] \n", "enteros= [1000, 900, 500, 400,100, 90, 50, 40,10, 9, 5, 4,1] \n",
"Letras = [\"M\", \"CM\", \"D\", \"CD\",\"C\", \"XC\", \"L\", \"XL\",\"X\", \"IX\", \"V\", \"IV\",\"I\"]\n", "Letras = [\"M\", \"CM\", \"D\", \"CD\",\"C\", \"XC\", \"L\", \"XL\",\"X\", \"IX\", \"V\", \"IV\",\"I\"]\n",
"romano=\"\"\n", "class ejercicio7:\n",
"while True:\n", " \n",
" def informacion(self):\n",
" print(\"Solo se leer del 1 al 3999\")\n",
" \n",
" def cambiar(self):\n",
" romano=\"\"\n",
" while True:\n",
" x=int(input(\"Ingresar número (Cero para terminar el programa):\"))\n", " x=int(input(\"Ingresar número (Cero para terminar el programa):\"))\n",
" if(x==0):\n", " if(x==0):\n",
" break\n", " break\n",
...@@ -534,7 +538,11 @@ ...@@ -534,7 +538,11 @@
" else:\n", " else:\n",
" i=i+1\n", " i=i+1\n",
" print(romano)\n", " print(romano)\n",
" romano=\"\"" " romano=\"\"\n",
" \n",
"x=ejercicio7()\n",
"x.informacion()\n",
"x.cambiar()"
] ]
}, },
{ {
......
...@@ -499,19 +499,17 @@ ...@@ -499,19 +499,17 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 319, "execution_count": 324,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"Solo se leer del 1 al 3999\n",
"Ingresar número (Cero para terminar el programa):10\n", "Ingresar número (Cero para terminar el programa):10\n",
"10:\n", "10:\n",
"X\n", "X\n",
"Ingresar número (Cero para terminar el programa):24\n",
"24:\n",
"XXIV\n",
"Ingresar número (Cero para terminar el programa):0\n" "Ingresar número (Cero para terminar el programa):0\n"
] ]
} }
...@@ -519,8 +517,14 @@ ...@@ -519,8 +517,14 @@
"source": [ "source": [
"enteros= [1000, 900, 500, 400,100, 90, 50, 40,10, 9, 5, 4,1] \n", "enteros= [1000, 900, 500, 400,100, 90, 50, 40,10, 9, 5, 4,1] \n",
"Letras = [\"M\", \"CM\", \"D\", \"CD\",\"C\", \"XC\", \"L\", \"XL\",\"X\", \"IX\", \"V\", \"IV\",\"I\"]\n", "Letras = [\"M\", \"CM\", \"D\", \"CD\",\"C\", \"XC\", \"L\", \"XL\",\"X\", \"IX\", \"V\", \"IV\",\"I\"]\n",
"romano=\"\"\n", "class ejercicio7:\n",
"while True:\n", " \n",
" def informacion(self):\n",
" print(\"Solo se leer del 1 al 3999\")\n",
" \n",
" def cambiar(self):\n",
" romano=\"\"\n",
" while True:\n",
" x=int(input(\"Ingresar número (Cero para terminar el programa):\"))\n", " x=int(input(\"Ingresar número (Cero para terminar el programa):\"))\n",
" if(x==0):\n", " if(x==0):\n",
" break\n", " break\n",
...@@ -534,7 +538,11 @@ ...@@ -534,7 +538,11 @@
" else:\n", " else:\n",
" i=i+1\n", " i=i+1\n",
" print(romano)\n", " print(romano)\n",
" romano=\"\"" " romano=\"\"\n",
" \n",
"x=ejercicio7()\n",
"x.informacion()\n",
"x.cambiar()"
] ]
}, },
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment