COMP CS 1101 Discussion Unit 7 CS 1101
Describe how tuples can be useful with loops over lists and dictionaries, and give Python code examples. Create your own code examples. Do not copy them from the textbook or any other source. Your descriptions and examples should include the following: the zip function, the enumerate function, and the items method. 51 words Permalink | Reply Re: Discussion Forum Unit 7 by Lansana Ansumana - Thursday, 17 October 2019, 5:17 AM The Solution - Lists, Tuples, and Dictionaries For these three problems, Python uses three different solutions - Tuples, lists, and dictionaries: Lists are what they seem - a list of values. Each one of them is numbered, starting from zero - the first one is numbered zero, the second 1, the third 2, etc. You can remove values from the list, and add new values to the end. Example: Your many cats' names. Tuples are just like lists, but you can't change their values. The values that you give it first up, are the values that you are stuck with for the rest of the program. Again, each value is numbered starting from zero, for easy reference. Example: the names of the months of the year
Escuela, estudio y materia
- Institución
-
Modern Technology School
- Grado
-
COMP CS 1101
Información del documento
- Subido en
- 15 de marzo de 2022
- Número de páginas
- 18
- Escrito en
- 2021/2022
- Tipo
- Examen
- Contiene
- Preguntas y respuestas
Temas
- comp cs 1101
-
comp cs 1101 discussion unit 7 cs 1101