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 4 fuera de 31 páginas
Examen

CNIT 155 Final Purdue (Python) Verified Multiple Choice and Conceptual Actual Exam Questions With Reviewed 100% Correct Detailed Answers Guaranteed Pass!!Current Update

Document preview thumbnail
Vista previa 4 fuera de 31 páginas

CNIT 155 Final Purdue (Python) Verified Multiple Choice and Conceptual Actual Exam Questions With Reviewed 100% Correct Detailed Answers Guaranteed Pass!!Current Update 1. T or F: The code below makes third have a value of 83.0 scores = [75.0, 68.5, 83.0] third = scores[2] - ANSWER True 2. T or F: Negative indices count from the right end. - ANSWER 3. What is the value of third after running the code below? scores = [75.0, 68.5, 83.0] third = scores[-1] - ANSWER 83.0 4. Which is an example of negative indices? - ANSWER True scores = [75.0, 68.5, 83.0] third = scores[-1] 5. Which is an example of positive indices? - ANSWER 83.0] third = scores[2] scores = [75.0, 68.5, 6. Slicing gives a... - ANSWER List of elements 7. Subscripting gives a... - ANSWER Single element

Vista previa del contenido

CNIT 155 Final Purdue (Python) Verified Multiple
Choice and Conceptual Actual Exam Questions
With Reviewed 100% Correct Detailed Answers

Guaranteed Pass!!Current Update


1. T or F: The code below makes third have a value of 83.0
scores = [75.0, 68.5, 83.0]

third = scores[2] - ANSWER True



2. T or F: Negative indices count from the right end. - ANSWER True


3. What is the value of third after running the code below?


scores = [75.0, 68.5, 83.0]

third = scores[-1] - ANSWER 83.0



4. Which is an example of negative indices? - ANSWER scores = [75.0,
68.5, 83.0]
third = scores[-1]



5. Which is an example of positive indices? - ANSWER scores = [75.0, 68.5,
83.0]
third = scores[2]

,6. Slicing gives a... - ANSWER List of elements



7. Subscripting gives a... - ANSWER Single element



8. Which is an example of slicing a list? - ANSWER scores = [68.5, 83.0]
9. exams = scores[1:3]



10.T or F: Each list is an object. - ANSWER True



11.Which is an example of how you call a list method? - ANSWER
list.methodName(arguments)


12.T or F: The in operator does not check for that exact method, and looks
"inside" elements. - ANSWER False



13.To search for an element in a list, you can use the... - ANSWER in
operator and index method


14.Which is an example of using the in operator to search for an element in a
list? - ANSWER Names = ["William", "Scott", "Sophia"]


if "William" in Names:

,15.Which is an example of using the index method to search for an element's
position in a list? - ANSWER Names = ["William", "Scott", "Sophia"]


loc = Names.index("Scott")
# loc is 1


16.Which is an example of using the index method to search for an element
from the start to the end of a list? - ANSWER List.index(elem, start,
end)


17.T or F: If the index method finds the element, it return its index (position)
inside the list. - ANSWER True


18.T or F: A ValueError is given when the index method searches for the
element and the element is not between start and end in the list. -
ANSWER True


19.T or F: A Searchgive Error is not given when the index method is used and
the element is NOT found. - ANSWER False



20.Which is an example of transversing a list with a for loop? - ANSWER
scores = [ 85, 72, 56, 98, 84, 72]


for grade in scores:
print(grade)

, 21.To get both indices and elements in transversing a list, use... - ANSWER
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)


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


23.What will be the result of the code below?
Names = ["William", "Scott", "Sophia"]

Names.insert (2, "Hanah") - ANSWER Names = ["William", "Scott",
"Hannah", "Sophia"]

Información del documento

Subido en
25 de junio de 2025
Número de páginas
31
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas
$9.99

¿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.
Vendido
276
Seguidores
87
Artículos
3182
Ú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