Programming is writing instructions that a computer can carry out. This topic covers the building blocks found in every language. Variables and constants store data of a type such as integer, real, string or Boolean. Sequence, selection and iteration control the order of steps: IF statements choose, and FOR, WHILE and REPEAT loops repeat. Arrays hold lists of values, and procedures and functions break a long program into parts. Programs also validate input, handle strings and read and write files. You practise these in pseudocode and in Python.
I takes the values 1, 3 and 5. Those positions hold P, A and E. The next value, 7, is past the length 6.
L N T starts at position 2. P L A uses a step of 1. A fourth character would need position 7, which does not exist.Log in to join the discussion.
Loading…