• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 2 fuera de 5 páginas
Examen

AP Comp Sci Principles Loops Redemption Questions & Answers

Document preview thumbnail
Vista previa 2 fuera de 5 páginas

0 1 2 3 4 - ANSWERSWhat is the output? for i in range (5): ..print(i, end = " ") time time time - ANSWERSWhat is the output? for x in range (3): ..print("time", end = " ") 12 - ANSWERSWhat is the output? j = 0 while j 10: ..j+=3 print(j) s e p t e - ANSWERSWhat is the output? word = "september" for let in word: ..if let != "m": ....print(let,) ..else: ....break --- --- --- - ANSWERSWhat is the output? x=3 while x 0: ..y = 3 ..while y0: ....print("-", end = " ") ....y-=1 ..x-=1 print() condition - ANSWERSWhat is the term for x called? while(x) while - ANSWERSA _______ loop is a block of code associated with a condition. As long as the condition is true, the loop will continue to run the block of code. 0 1 2 3 4 - ANSWERSWhat is the output? x = 0 while(x5): ..print(x) ..x+=1 20 16 12 8 4 - ANSWERSWhat is the output? x = 20 while(x0): ..print(x) ..x=x-4 While - ANSWERS_______ loops repeat code as long as a condition is true 4 915 5 91 - ANSWERSWhat is the output? num=9154 print(num%10) print(num/10); num/=10 print(num%10) print(num/10) 4 5 1 9 - ANSWERSWhat is the output? number=9154 while(number0): ..print(number%10) ..number=number/10 For - ANSWERS_______ loops run a set number of times Hi Hi Hi - ANSWERSWhat is the output? for x in range(3): ..print("Hi") 0 1 2 3 4 - ANSWERSWhat is the output? for z in range(5): ..print z 12 13 14 15 - ANSWERSWhat is the output? for r in range (12,16): ..print(r) H e l l o - ANSWERSFor c in "Hello": ..print(c, end =" ") For each - ANSWERS_______ loops run through every character in a string Break - ANSWERSThe keyword _______ allows you to stop a loop early C o m p - ANSWERSWhat is the output? word = "Computer Science" for w in word: ..if w == "u": ....break ..print(w) Nested - ANSWERSIn ______ loops, loops can go inside other loops x is 0 y is 0 y is 1 x is 1

Vista previa del contenido

AP Comp Sci Principles Loops
Redemption Questions & Answers
0 1 2 3 4 - ANSWERSWhat is the output?
for i in range (5):
..print(i, end = " ")

time time time - ANSWERSWhat is the output?
for x in range (3):
..print("time", end = " ")

12 - ANSWERSWhat is the output?
j=0
while j < 10:
..j+=3
print(j)

s
e
p
t
e - ANSWERSWhat is the output?
word = "september"
for let in word:
..if let != "m":
....print(let,)
..else:
....break

---
---
--- - ANSWERSWhat is the output?
x=3
while x > 0:
..y = 3
..while y>0:
....print("-", end = " ")
....y-=1
..x-=1
print()

condition - ANSWERSWhat is the term for x called?
while(x)

, while - ANSWERSA _______ loop is a block of code associated with a condition. As
long as the condition is true, the loop will continue to run the block of code.

0
1
2
3
4 - ANSWERSWhat is the output?
x=0
while(x<5):
..print(x)
..x+=1

20
16
12
8
4 - ANSWERSWhat is the output?
x = 20
while(x>0):
..print(x)
..x=x-4

While - ANSWERS_______ loops repeat code as long as a condition is true

4
915
5
91 - ANSWERSWhat is the output?
num=9154
print(num%10)
print(num/10);
num/=10
print(num%10)
print(num/10)

4
5
1
9 - ANSWERSWhat is the output?
number=9154
while(number>0):
..print(number%10)
..number=number/10

Información del documento

Subido en
21 de octubre de 2024
Número de páginas
5
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas
$12.49

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
Bestgrades2
3.8
(5)
Vendido
38
Seguidores
0
Artículos
5141
Última venta
1 mes hace




Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes