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
9 questions
Lenguaje de Programación C++. Parte 1.

Quiz
•
University
10 questions
Tema 3: Control de Flujo

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

Quiz
•
University
13 questions
Cuestionario acerca de algoritmos

Quiz
•
University
10 questions
FP Tema 3: Control de flujo

Quiz
•
University
10 questions
UT11. Guiones BBDD

Quiz
•
University
10 questions
DS UNIT-2 TEST-3

Quiz
•
University
5 questions
Lenguaje de Programación I - Test 1

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

Quiz
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University