Python exam review 2023 with 100% correct answers
how do we add a list to a list? list[2] = [1, 2, 3] how do we ad elements of a list to a list? list[2:2] = [1,2,3] how do we delete elements from a list? del list[1] what's another way of deleting elements from a list, besides del? list[1] = [] what does 3 * [0] return? [0,0,0] if you really want to copy a list, what can you do? list2 = list1[:] difference between append and extend? append adds whole argument as single element, while extend adds each item of argument as element how to insert exactly one element? t(position, element) what does remove do to a list? removes first element in list with given value what does () do? what does () do? what does () do? what does (key) return if the key exists? the value of the key what does (key) return if the key does not exist? None what kind of objects do dictionary methods return? view
Información del documento
- Subido en
- 28 de julio de 2023
- Número de páginas
- 13
- Escrito en
- 2022/2023
- Tipo
- Examen
- Contiene
- Preguntas y respuestas