|
1 | 1 | { |
2 | | - "title": "Entrada de datos con <code class=\"language-python\">input()</code>", |
| 2 | + "title": "Entrada de Datos con <code class=\"language-python\">input()</code>", |
3 | 3 | "description": "", |
4 | 4 | "content": [ |
5 | 5 | { |
|
17 | 17 | { |
18 | 18 | "type": "list", |
19 | 19 | "items": [ |
20 | | - "Muestra un mensaje (si se lo das)", |
21 | | - "Espera a que el usuario escriba algo", |
22 | | - "Devuelve lo escrito como una cadena de texto (<code class=\"language-python\">str</code>)" |
| 20 | + "Muestra un mensaje (si se lo das).", |
| 21 | + "Espera a que el usuario escriba algo.", |
| 22 | + "Devuelve lo escrito como una cadena de texto (<code class=\"language-python\">str</code>)." |
23 | 23 | ] |
24 | 24 | }, |
25 | 25 | { |
|
49 | 49 | }, |
50 | 50 | { |
51 | 51 | "type": "subtitle1", |
52 | | - "text": "Convertir lo que ingresa el usuario" |
| 52 | + "text": "Convertir lo Que Ingresa el Usuario" |
53 | 53 | }, |
54 | 54 | { |
55 | 55 | "type": "paragraph", |
|
106 | 106 | }, |
107 | 107 | { |
108 | 108 | "type": "subtitle1", |
109 | | - "text": "Procesar datos ingresados" |
| 109 | + "text": "Procesar Datos Ingresados" |
110 | 110 | }, |
111 | 111 | { |
112 | 112 | "type": "paragraph", |
|
131 | 131 | }, |
132 | 132 | { |
133 | 133 | "type": "subtitle1", |
134 | | - "text": "Errores comunes con <code class=\"language-python\">input()</code>" |
| 134 | + "text": "Errores Comunes Con <code class=\"language-python\">input()</code>" |
135 | 135 | }, |
136 | 136 | { |
137 | 137 | "type": "subtitle2", |
138 | | - "text": "1. Olvidar que devuelve texto" |
| 138 | + "text": "1. Olvidar Que Devuelve Texto" |
139 | 139 | }, |
140 | 140 | { |
141 | 141 | "type": "code", |
142 | 142 | "text": "n = input(\"Número: \")\nprint(n + 10) # ERROR" |
143 | 143 | }, |
144 | 144 | { |
145 | 145 | "type": "test-button", |
146 | | - "text": "Probar error >>", |
| 146 | + "text": "Probar Error >>", |
147 | 147 | "code": "n = input(\"Número: \")\nprint(n + 10) # ERROR" |
148 | 148 | }, |
149 | 149 | { |
150 | 150 | "type": "subtitle2", |
151 | | - "text": "2. Tratar de convertir un texto no válido" |
| 151 | + "text": "2. Tratar de Convertir un Texto No Válido" |
152 | 152 | }, |
153 | 153 | { |
154 | 154 | "type": "code", |
155 | | - "text": "int(\"hola\") # ERROR" |
| 155 | + "text": "text = input(\"Input: \") # Input: hello\nint(text) # ERROR" |
156 | 156 | }, |
157 | 157 | { |
158 | 158 | "type": "test-button", |
159 | | - "text": "Probar error >>", |
160 | | - "code": "int(\"hola\")" |
| 159 | + "text": "Probar Error >>", |
| 160 | + "code": "text = input(\"Input: \") # Input: hello\nint(text) # ERROR" |
161 | 161 | }, |
162 | 162 | { |
163 | 163 | "type": "note", |
164 | 164 | "text": "📌 <strong>Nota:</strong><br>Más adelante aprenderás a manejar estos errores con <code class=\"language-python\">try</code> y <code class=\"language-python\">except</code>." |
165 | 165 | }, |
166 | 166 | { |
167 | 167 | "type": "subtitle1", |
168 | | - "text": "Ejemplos útiles" |
| 168 | + "text": "Ejemplos Útiles" |
169 | 169 | }, |
170 | 170 | { |
171 | 171 | "type": "subtitle2", |
172 | | - "text": "Ejemplo 1: Saludo personalizado" |
| 172 | + "text": "Ejemplo 1: Saludo Personalizado" |
173 | 173 | }, |
174 | 174 | { |
175 | 175 | "type": "code", |
|
190 | 190 | }, |
191 | 191 | { |
192 | 192 | "type": "subtitle2", |
193 | | - "text": "Ejemplo 2: Suma interactiva" |
| 193 | + "text": "Ejemplo 2: Suma Interactiva" |
194 | 194 | }, |
195 | 195 | { |
196 | 196 | "type": "code", |
|
211 | 211 | }, |
212 | 212 | { |
213 | 213 | "type": "subtitle2", |
214 | | - "text": "Ejemplo 3: Repetición con texto" |
| 214 | + "text": "Ejemplo 3: Repetición Con Texto" |
215 | 215 | }, |
216 | 216 | { |
217 | 217 | "type": "code", |
218 | | - "text": "palabra = input(\"Escribe uan palabra: \")\nprint(palabra * 3)" |
| 218 | + "text": "palabra = input(\"Escribe una palabra: \")\nprint(palabra * 3)" |
219 | 219 | }, |
220 | 220 | { |
221 | 221 | "type": "paragraph", |
|
225 | 225 | "type": "code", |
226 | 226 | "text": "Escribe una palabra: Python\nPythonPythonPython" |
227 | 227 | }, |
| 228 | + { |
| 229 | + "type": "test-button", |
| 230 | + "text": "Probar >>", |
| 231 | + "code": "palabra = input(\"Escribe una palabra: \")\nprint(palabra * 3)" |
| 232 | + |
| 233 | + }, |
228 | 234 | { |
229 | 235 | "type": "tip", |
230 | 236 | "text": "⭐ <strong>Tip:</strong><br>Cuando repites una cadena, no se agregan espacios automáticamente." |
231 | 237 | }, |
232 | 238 | { |
233 | 239 | "type": "subtitle1", |
234 | | - "text": "Ejercicios" |
| 240 | + "text": "Ejercicios Para Practicar" |
235 | 241 | }, |
236 | 242 | { |
237 | 243 | "type": "subtitle2", |
238 | | - "text": "Ejercicio 1: Saludo simple" |
| 244 | + "text": "Ejercicio 1: Saludo Simple" |
239 | 245 | }, |
240 | 246 | { |
241 | 247 | "type": "paragraph", |
|
256 | 262 | }, |
257 | 263 | { |
258 | 264 | "type": "test-button", |
259 | | - "text": "Probar solución >>", |
| 265 | + "text": "Probar Solución >>", |
260 | 266 | "code": "nombre = input(\"Escribe tu nombre: \")\nprint(\"Hola\", nombre)" |
261 | 267 | } |
262 | 268 | ] |
263 | 269 | }, |
264 | 270 | { |
265 | 271 | "type": "subtitle2", |
266 | | - "text": "Ejercicio 2: Edad en el futuro" |
| 272 | + "text": "Ejercicio 2: Edad en el Futuro" |
267 | 273 | }, |
268 | 274 | { |
269 | 275 | "type": "paragraph", |
|
272 | 278 | { |
273 | 279 | "type": "test-button", |
274 | 280 | "text": "Practicar >>", |
275 | | - "code": "# Pídele al usuario su nombre y muéstrale un saludo" |
| 281 | + "code": "# Pídele al usuario su edad y dile cuántos años\n# tendrá en 5 años" |
276 | 282 | }, |
277 | 283 | { |
278 | 284 | "type": "collapsible", |
|
284 | 290 | }, |
285 | 291 | { |
286 | 292 | "type": "test-button", |
287 | | - "text": "Probar solución >>", |
| 293 | + "text": "Probar Solución >>", |
288 | 294 | "code": "edad = int(input(\"¿Cuántos años tienes? \"))\nprint(\"En 5 años tendrás\", edad + 5)" |
289 | 295 | } |
290 | 296 | ] |
291 | 297 | }, |
292 | 298 | { |
293 | 299 | "type": "subtitle2", |
294 | | - "text": "Ejercicio 3: Multiplicador de palabras" |
| 300 | + "text": "Ejercicio 3: Multiplicador de Palabras" |
295 | 301 | }, |
296 | 302 | { |
297 | 303 | "type": "paragraph", |
|
300 | 306 | { |
301 | 307 | "type": "test-button", |
302 | 308 | "text": "Practicar >>", |
303 | | - "code": "# Pídele al usuario una palabra y un número. Muestra la palabra repetida ese número de veces" |
| 309 | + "code": "# Pídele al usuario una palabra y un número.\n# Muestra la palabra repetida ese número de veces" |
304 | 310 | }, |
305 | 311 | { |
306 | 312 | "type": "collapsible", |
|
312 | 318 | }, |
313 | 319 | { |
314 | 320 | "type": "test-button", |
315 | | - "text": "Probar solución >>", |
| 321 | + "text": "Probar Solución >>", |
316 | 322 | "code": "palabra = input(\"Escribe una palabra: \")\ncantidad = int(input(\"¿Cuántas veces quieres repetirla? \"))\nprint(palabra * cantidad)" |
317 | 323 | } |
318 | 324 | ] |
319 | 325 | }, |
320 | 326 | { |
321 | 327 | "type": "subtitle2", |
322 | | - "text": "Ejercicio 4: Conversión de grados" |
| 328 | + "text": "Ejercicio 4: Conversión de Grados" |
323 | 329 | }, |
324 | 330 | { |
325 | 331 | "type": "paragraph", |
|
328 | 334 | { |
329 | 335 | "type": "test-button", |
330 | 336 | "text": "Practicar >>", |
331 | | - "code": "# Pídele al usuario una temperatura en grados Celsius y conviértelos a Fahrenheit (Muéstraselo al usuario)" |
| 337 | + "code": "# Pídele al usuario una temperatura en grados\n# Celsius y conviértelos a Fahrenheit\n# (Muéstraselo al usuario)" |
332 | 338 | }, |
333 | 339 | { |
334 | 340 | "type": "collapsible", |
|
340 | 346 | }, |
341 | 347 | { |
342 | 348 | "type": "test-button", |
343 | | - "text": "Probar solución >>", |
| 349 | + "text": "Probar Solución >>", |
344 | 350 | "code": "c = float(input(\"Temperatura en Celsius: \"))\nf = (c * 9 / 5) + 32\nprint(\"Equivalen a\", f, \"°F\")" |
345 | 351 | } |
346 | 352 | ] |
347 | 353 | }, |
348 | 354 | { |
349 | 355 | "type": "subtitle1", |
350 | | - "text": "Conclusión del tema" |
| 356 | + "text": "Conclusiones de la Unidad" |
351 | 357 | }, |
352 | 358 | { |
353 | 359 | "type": "paragraph", |
|
356 | 362 | { |
357 | 363 | "type": "list", |
358 | 364 | "items": [ |
359 | | - "A usar <code class=\"language-python\">input()</code> para recibir texto desde el teclado", |
360 | | - "Que todo lo que devuelve <code class=\"language-python\">input</code> es string (<code class=\"language-python\">str</code>)", |
361 | | - "A convertir esos textos a números usando <code class=\"language-python\">int()</code> y <code class=\"language-python\">float()</code>", |
362 | | - "A procesar la información ingresada para realizar cálculos o personalizar mensajes", |
363 | | - "A evitar errores comunes como mezclar texto y números" |
| 365 | + "A usar <code class=\"language-python\">input()</code> para recibir texto desde el teclado.", |
| 366 | + "Que todo lo que devuelve <code class=\"language-python\">input</code> es string (<code class=\"language-python\">str</code>).", |
| 367 | + "A convertir esos textos a números usando <code class=\"language-python\">int()</code> y <code class=\"language-python\">float()</code>.", |
| 368 | + "A procesar la información ingresada para realizar cálculos o personalizar mensajes.", |
| 369 | + "A evitar errores comunes como mezclar texto y números." |
364 | 370 | ] |
365 | 371 | } |
366 | 372 | ] |
|
0 commit comments