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 3 fuera de 24 páginas
Examen

PURDUE CNIT 155 FINAL EXAM (PYTHON) QUESTIONS AND ANSWERS 2026 VERIFIED.

Document preview thumbnail
Vista previa 3 fuera de 24 páginas

PURDUE CNIT 155 FINAL EXAM (PYTHON) QUESTIONS AND ANSWERS 2026 VERIFIED.

Vista previa del contenido

PURDUE CNIT 155 FINAL EXAM
(PYTHON) QUESTIONS AND ANSWERS
2026 VERIFIED.



What is a List? - ANS A data structure that can store many values of under one name


Which is an example of how to create an empty list? - ANS Variable = []
Variable = list()


Which is an example of how to create a list with predefined values? - ANS colors = ["red,
"yellow", "blue"]


To create a list with predefined values, you have to.... - ANS Put a sequence of items in []


What does list1.append(elem) do? - ANS Adds a single element to the end of the list


What does list1.insert(index, elem) do? - ANS Inserts the element elem at the given index,
shifting elements to the right


What does list1.extend(list2) do? - ANS Add the elements in list2 to the end of the list.


T or F: The extend method is not only used with a list. - ANS False



@COPYRIGHT ALL RIGHTS RESERVED PAGE 1 OF 24

,T or F: Using + or += on a list is similar to using the extend method. - ANS True


How do you access the individual element in a list using an index? - ANS list1[index]


What are characteristics of Positive Indexes? - ANS First element in the list has index 0,
second element has index 1, and n'th element is n-1


What are characteristics of Negative Indexes? - ANS Identify positions relative to the end of
the list, index -1 identifies the last element, and -2 identifies the next to last element, etc.


What does Function do? - ANS Is a description


What does len do? - ANS Returns the number of items in the list


What does min do? - ANS Returns the minimum among the elements in the list


What does max do? - ANS Returns the maximum among the elements in the list


What does sum do? - ANS Returns the sum of all the elements in the list. (applies to list of
numerical values only)


Given a list, you may use ________ to randomize the order of the elements in a list. -
ANS Shuffle


What do you type to import the shuffle function and use the shuffle function with a list? -
ANS from random import shuffle
shuffle(list1)


You can refer to elements of a list using the... - ANS Subscript syntax


@COPYRIGHT ALL RIGHTS RESERVED PAGE 2 OF 24

, T or F: The code below makes third have a value of 83.0


scores = [75.0, 68.5, 83.0]

third = scores[2] - ANS True


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


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


scores = [75.0, 68.5, 83.0]

third = scores[-1] - ANS 83.0


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


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


Slicing gives a... - ANS List of elements


Subscripting gives a... - ANS Single element


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


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



@COPYRIGHT ALL RIGHTS RESERVED PAGE 3 OF 24

Información del documento

Subido en
28 de mayo de 2026
Número de páginas
24
Escrito en
2025/2026
Tipo
Examen
Contiene
Preguntas y respuestas
$12.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.
Fyndlay
3.7
(75)
Vendido
421
Seguidores
81
Artículos
20077
Última venta
4 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