Escrito por estudiantes que aprobaron Inmediatamente disponible después del pago Leer en línea o como PDF ¿Documento equivocado? Cámbialo gratis 4,6 TrustPilot
logo-home
Document preview thumbnail
Vista previa 2 fuera de 13 páginas
Examen

CNIT 155 CORE EXAMS SET 2025/2026 QUESTIONS WITH ANSWERS RATED A+

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

CNIT 155 CORE EXAMS SET 2025/2026 QUESTIONS WITH ANSWERS RATED A+

Vista previa del contenido

CNIT 155 CORE EXAMS SET 2025/2026 QUESTIONS WITH
ANSWERS RATED A+
✔✔To get both indices and elements in transversing a list, use... - ✔✔A loop controlled
with range(len(list)) with subscripting

for index in range(len(scores)):
print (index,"\t"
,grade[i])

Enumerate(mylist) to control the

for loop
for index, grade in enumerate(scores):
print (index,"\t"
,grade)

✔✔Which is an example of using the extend method to add a whole list to the end of a
list? - ✔✔scores = [ 85, 72, 56, 98, 84, 72]
scores.extend([55, 88, 79])

✔✔What will be the result of the code below?
Names = ["William", "Scott", "Sophia"]
Names.insert (2, "Hanah") - ✔✔Names = ["William", "Scott", "Hannah", "Sophia"]

✔✔T or F: Append, extend, and insert return something. - ✔✔False

✔✔What will be the result of this code?
colors = colors.append("yellow") - ✔✔ERROR
colors = None

✔✔What will be the result of this code?
colors.append("yellow") - ✔✔Changes colors to have "yellow" at end

✔✔What will be the result of this code?
colors + primaries - ✔✔ERROR
Longer list will be thrown out

✔✔What will be the result of this code?
colors = colors + primaries - ✔✔Returns a new list

✔✔T or F: You can delete from a list by index. - ✔✔True

✔✔Which is an example of deleting from a list using index? - ✔✔del list[index]

, ✔✔Deleting from a list using index... - ✔✔Removes the element at position index and
shifts down the following elements to fill in the gap

✔✔Which is an example of deleting a range from a list by using a slice? - ✔✔del list[2 :
5]
# removes elements at positions 2, 3, and 4

✔✔What does colors.remove("blue") do? - ✔✔Searches for the first occurrence of "blue
and deleters it

✔✔What does the "search and destroy" method do? - ✔✔Searches for and removes a
specific value from a list

✔✔What happens if the specific value can not be found using the "search and destroy"
method? - ✔✔Gives a runtime error

✔✔Which is an example fo the "search and destroy" method using del? - ✔✔if "blue" in
colors:
pos =
colors.index("blue")
del colors[pos]

✔✔What does the reverse method do to a list? - ✔✔Reverses the order of a list

✔✔Which is an example of using the reverse method on a list? - ✔✔mylist = ["red",
"green", "blue"]

mylist.reverse()

print(mylist) gives ["blue", "green", "red"]

✔✔T or F: After using the reverse method on a list, the original order is lost. - ✔✔True

✔✔T or F: The reverse method does not return a value. - ✔✔True

✔✔What will be the result of this code?
mylist = mylist.reverse() - ✔✔ERROR
mylist becomes None

✔✔Which is an example of a new reversed copy of the list? (original list remains
unchanged) - ✔✔backwards = list(reversed(mylist))

✔✔Reverse is a.... - ✔✔Method that mutates the list that is its argument

Información del documento

Subido en
18 de junio de 2025
Número de páginas
13
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.
BOARDWALK
3.5
(40)
Vendido
276
Seguidores
8
Artículos
32861
Última venta
6 días 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