Dominando Bucles: For y While en Python 🐍

Quiz
•
Computers
•
University
•
Medium

Pedro Orlando Gatica Guajardo
Used 2+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
¿Cuál es la principal diferencia entre un bucle for y uno while en Python?
for se usa solo con números, while con texto
while repite mientras una condición sea verdadera, for itera sobre una secuencia
Ambos son iguales
for se usa con condicionales, while con funciones
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
¿Qué imprime el siguiente código?
for i in range(3):
print(i)
1 2 3
0 1 2
0 1 2 3
1 2
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
¿Qué palabra clave debe usarse para salir de un bucle while en Python antes de que termine?
exit
stop
break
quit
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
¿Cuántas veces se ejecuta este ciclo for?
for i in range(5):
print("Hola")
4
5
6
infinito
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
¿Cuál de los siguientes códigos usa correctamente un bucle while?
while x < 5 { print(x) }
while x < 5: print(x)
while (x < 5) then print(x)
do while x < 5: print(x)
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Un bucle for siempre necesita una función range().
Verdadero
Falso
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
¿Qué función tiene este fragmento de código?
while respuesta.lower() != "sí":
respuesta = input("¿Quieres salir del bucle? (sí/no): ")
Ejecuta una vez y termina
Pregunta hasta que el usuario escriba "sí"
Siempre muestra "sí"
Tiene error de sintaxis
Create a free account and access millions of resources
Similar Resources on Wayground
12 questions
Programación

Quiz
•
3rd Grade - University
15 questions
Repaso de Fundamentos de programación

Quiz
•
University
14 questions
Ciclos y Funciones en Python

Quiz
•
University
15 questions
Cuestionario: Fundamentos de Programación

Quiz
•
University
10 questions
Python 2

Quiz
•
University
10 questions
Programación Avanzada II - Parte 5

Quiz
•
University
10 questions
10° Estructura y Diseño de un Algoritmo

Quiz
•
10th Grade - University
10 questions
Estructuras de programación y lógica en Ren'Py

Quiz
•
9th Grade - University
Popular Resources on Wayground
50 questions
Trivia 7/25

Quiz
•
12th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
11 questions
Negative Exponents

Quiz
•
7th - 8th Grade
12 questions
Exponent Expressions

Quiz
•
6th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade