• ¿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 14 páginas
Examen

Python Review Practice Study Test.

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

Python Review Practice Study Test. how do we add a list to a list? - CORRECT ANSWER list[2] = [1, 2, 3] how do we ad elements of a list to a list? - CORRECT ANSWER list[2:2] = [1,2,3] how do we delete elements from a list? - CORRECT ANSWER del list[1] what's another way of deleting elements from a list, besides del? - CORRECT ANSWER list[1] = [] what does 3 * [0] return? - CORRECT ANSWER [0,0,0] if you really want to copy a list, what can you do? - CORRECT ANSWER list2 = list1[:] difference between append and extend? - CORRECT ANSWER append adds whole argument as single element, while extend adds each item of argument as element how to insert exactly one element? - CORRECT ANSWER t(position, element) what does remove do to a list? - CORRECT ANSWER removes first element in list with given value what does () do? - CORRECT ANSWER what does () do? - CORRECT ANSWER what does () do? - CORRECT ANSWER what does (key) return if the key exists? - CORRECT ANSWER the value of the key what does (key) return if the key does not exist? - CORRECT ANSWER None what kind of objects do dictionary methods return? - CORRECT ANSWER view what are the three dictionary methods? - CORRECT ANSWER keys(), values(), items() what is the advantage of returning dictionary methods as view objects rather than as lists? - CORRECT ANSWER thye are dynamic and reflect changes to the dictionary define list - CORRECT ANSWER collection of different objects indexed by numbers what is the big difference between strings and lists? - CORRECT ANSWER strings are immutable, lists are mutable what is the difference between list[2] = [1,2,3] and list[2:2] = [1,2,3]? - CORRECT ANSWER [2] adds as list, [2:2] adds as separate elements how many elements does list[2:3] represent? - CORRECT ANSWER one where does a slice end? - CORRECT ANSWER right before the second index of the slice how do you remove element three from a list by slicing? - CORRECT ANSWER list[2:3] = [] is len a function or a method? - CORRECT ANSWER function how to find the length of a list? - CORRECT ANSWER len(list) what do we have to know about the operands of list operators? - CORRECT ANSWER both must be lists how to determine whether a value is an element of list? - CORRECT ANSWER element in list what does in do? - CORRECT ANSWER determines whether element is in list what does in operator return if element is fond? - CORRECT ANSWER TRUE what does in return if element is not found? - CORRECT ANSWER FALSE how do you return an entire list by slicing? - CORRECT ANSWER list[:] how do you reverse the order of elements of a list in place? - CORRECT ANSWER se() what are two situations for which tuples can be used but lists cannot? - CORRECT ANSWER % formatting, dictionary keys how do you get a dictionary value - CORRECT ANSWER dict[key] what are strings? - CORRECT ANSWER collection of characters that are stored together what do strings represent? - CORRECT ANSWER arbitrary text what are three ways of creating strings from text? - CORRECT ANSWER single, double, triple quotes what are two ways to make multiline strings? - CORRECT ANSWER triple quotes, backslash backspace - CORRECT ANSWER b horizontal tab - CORRECT ANSWER t

Vista previa del contenido

Python Review Practice Study Test.

how do we add a list to a list? - CORRECT ANSWER list[2] = [1, 2, 3]



how do we ad elements of a list to a list? - CORRECT ANSWER list[2:2] = [1,2,3]



how do we delete elements from a list? - CORRECT ANSWER del list[1]



what's another way of deleting elements from a list, besides del? - CORRECT ANSWER list[1] = []



what does 3 * [0] return? - CORRECT ANSWER [0,0,0]



if you really want to copy a list, what can you do? - CORRECT ANSWER list2 = list1[:]



difference between append and extend? - CORRECT ANSWER append adds whole argument as single
element, while extend adds each item of argument as element



how to insert exactly one element? - CORRECT ANSWER list.insert(position, element)



what does remove do to a list? - CORRECT ANSWER removes first element in list with given value



what does list.sort() do? - CORRECT ANSWER



what does list.index() do? - CORRECT ANSWER



what does list.count() do? - CORRECT ANSWER



what does dict.get(key) return if the key exists? - CORRECT ANSWER the value of the key

, what does dict.get(key) return if the key does not exist? - CORRECT ANSWER None



what kind of objects do dictionary methods return? - CORRECT ANSWER view



what are the three dictionary methods? - CORRECT ANSWER keys(), values(), items()



what is the advantage of returning dictionary methods as view objects rather than as lists? - CORRECT
ANSWER thye are dynamic and reflect changes to the dictionary



define list - CORRECT ANSWER collection of different objects indexed by numbers



what is the big difference between strings and lists? - CORRECT ANSWER strings are immutable, lists are
mutable



what is the difference between list[2] = [1,2,3] and list[2:2] = [1,2,3]? - CORRECT ANSWER [2] adds as
list, [2:2] adds as separate elements



how many elements does list[2:3] represent? - CORRECT ANSWER one



where does a slice end? - CORRECT ANSWER right before the second index of the slice



how do you remove element three from a list by slicing? - CORRECT ANSWER list[2:3] = []



is len a function or a method? - CORRECT ANSWER function



how to find the length of a list? - CORRECT ANSWER len(list)



what do we have to know about the operands of list operators? - CORRECT ANSWER both must be lists

Información del documento

Subido en
5 de abril de 2025
Número de páginas
14
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.
ROSEGRADES
3.4
(35)
Vendido
236
Seguidores
87
Artículos
12121
Última venta
3 semanas 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