¿Cuál es la principal diferencia entre un bucle for y uno while en Python?
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
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 Quizizz
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
Estructuras de programación y lógica en Ren'Py

Quiz
•
9th Grade - University
10 questions
Tema 3: Control de Flujo

Quiz
•
University
13 questions
Programación-Diagrama de Flujo

Quiz
•
University
12 questions
Programación

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

Quiz
•
University
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade