Mapa mental
Unit 2A Programming-Arrays
Contenido del mapa
Unit 2A Programming-Arrays
An array is a data structure that allows you to hold several values, all of the same type with one name
To print an element in the array you have to put the array name/indentifier and the index e.g. cars[0]- this will print the first item in the list named cars
- the index starts at 0 not 1
https://www.w3schools.com/python/python_arrays.asp https://www.bbc.co.uk/bitesize/guides/zfnny4j/revision/7
Identifier- the name given to the array
Values in elements can be overwritten at any point, simply by assigning another value to that element. e.g cars[0]← Ford (this now makes the first element in the list Ford, replacing it with the element that was there, the rest of the list stays the same).
Two Dimensional arrays-A two-dimensional array can hold more than one set of data. This type of array is like a table, with data held in rows and columns.
- To print an element in a two-dimensional array you have to put the array name/identifier and the index which is two numbers- Identifier[IntExp][IntExp]
- tables ← [ [1, 2, 3], [2, 4, 6], [3, 6, 9], [4, 8, 12] ] tables[3][1] will print 8 because it is in the third group (index starting from 0)[4,8,12] and it is position 1 (index starting from 0)
- To print an element in a two-dimensional array you have to put the array name/identifier and the index which is two numbers- Identifier[IntExp][IntExp]
To find the length of the array in Pseudocode use the function LEN(identifier) e.g LEN(cars)
Información
- Descripción
- Mapa Mental sobre Unit 2A Programming-Arrays, creado por sydelle wontumi el 14/01/2020.
- Creado por
- sydelle wontumi
- Visitas
- 0
- Valoración