Data Types - Arrays and Records

Descripción

A level (1 - Fundamentals of Programming (1.1)) Computing Diapositivas sobre Data Types - Arrays and Records , creado por Adele Tidball el 22/07/2020.
Adele Tidball
Diapositivas por Adele Tidball, actualizado hace más de 1 año
Adele Tidball
Creado por Adele Tidball hace más de 4 años
6
0

Resumen del Recurso

Diapositiva 1

    Data Type - Arrays: 1D/Lists
    Arrays - a data structure that can store a group of data values, of the same type, under the same name  They are the most useful when you have lots of related data that you want to store and it doesn't make sense to use separate variables - eg. names of people in a class  Element - each piece of data in an array - each element can be accessed using its position (or index) in the array Creating arrays:  Python - people = {"Mark", "Adam", "Shelly"} Pseudocode - people <- {"Mark", "Adam", "Shelly"}     2.. Retrieving elements:  Remember in pseudocode, positions are numbered starting at 0 and in python, positions are numbered starting at 1  Python - print people[1]  Pseudocode - OUTPUT people[0]
       3. Changing elements: Python - people[1] = "Tami" Pseudocode - people[0] <- "Tami"     4. Number of elements: Python - len(people) Pseudocode - LEN(people) Combining these array functions with FOR loops, will give you a systematic way of accessing and changing all of the elements in an array

Diapositiva 2

    Data Type: Arrays - 2 Dimensional Arrays
    Creating arrays:  trees <- [['oak', 'ash'], ['beech', 'cedar'], ['pine', 'elm']] Positions of elements:  The position of an element is usually written [a][b] or [a,b], where a represents the separate list and b represents the position inside the individual lists.  trees[0][0] - oak  trees[0][1] - ash trees[2][0] - pine  Length of an array or a list in the array: Length of an array says how many individual lists there are in the array = LEN(trees) - 3  Length of a list in an array says how many elements there are in the list = LEN(trees[1]) - 2  
    Pie de foto: : You can think of a 2D array as a grid or table

Diapositiva 3

Mostrar resumen completo Ocultar resumen completo

Similar

A level Computing Quiz
Zacchaeus Snape
Types and Components of Computer Systems
Jess Peason
Input Devices
Jess Peason
Output Devices
Jess Peason
Computing
Kwame Oteng-Adusei
Pack of playing cards answer
Karl Taylor
Code Challenge Flow Chart
Charlotte Hilton
Computing Hardware - CPU and Memory
ollietablet123
Computer Systems
lisawinkler10
Computer science quiz
Ryan Barton
Input, output and storage devices
Mr A Esch