# OCR GCSE Computing and arrays

Discussion in 'Computing and ICT' started by ICT Don, Jul 18, 2012.

1. ### ICT DonNew commenter

I am currently planning to start teaching OCR GCSE Computing in September. Looking through the specification I have noticed that there is a requirement to:
- use one-dimensional arrays
- define and use arrays as appropriate when solving problems.

I was planning on using Python. Does anyone know if I can just use lists or do I have to use the array module to create constrained array structures?

2. ### ICT DonNew commenter

I am currently planning to start teaching OCR GCSE Computing in September. Looking through the specification I have noticed that there is a requirement to:
- use one-dimensional arrays
- define and use arrays as appropriate when solving problems.

I was planning on using Python. Does anyone know if I can just use lists or do I have to use the array module to create constrained array structures?

3. ### mymoose

This is GCSE! Why not stick to a nice simple procedural language, as the OCR Computing course is designed for procedural languages. For example, use BBCBASIC to introduce arrays and it is a doddle. Use Pascal and it's easy. Go down the python route and you are making a simple topic complex. Remember this is an introductory course for youngsters.

4. ### Blissx

You can create a string array in Python. Declare your array as normal (import array) and use fromstring() to read and write text and characters to it. Such as a.fromstring("Hello", "Goodbye"). The spec requires that pupils know and can use 1D arrays (which are pretty easy). Lists are different.

5. ### JaquesJaquesLiverotEstablished commenter

Assuming that Pete and Berni's Philosophical Steakhouse is well-and-truly shut, and in terms that a GCSE student would understand, what is the difference between an array and a list?
It strikes me that, at this level, they're effectively the same - you have a collection of values relating to similar things and you can retrieve them using an index.
Actually, if you look at this page, it seems that Python lists aren't lists anyway, and different languages seem to jumble up terms like "array" and "list":

6. ### Blissx

A list consists of individual types of data, each pointing to the next in the list.
An array consists of contiguous chunks memory of predetermined/set size.
However, I do appreciate that some programming languages blur the lines in their syntax. My advice would be to ask the great ones at OCR and confirm with them what they would be happy with.

7. ### jason_pitt

In terms of the controlled assessment module (A453) there is nothing wrong with students using lists to solve problems where other languages would use arrays.

From the programmer's point of view the main differences between Python's list structure and arrays in other languages are:
• Lists in Python can hold multiple data types.
• Lists are resized according to their contents. This means you can add as many items as you want to the list and remove items from any position.
In my opinion both of aspects add flexibility though as has been pointed out the lines of what arrays are, are very blurred and some languages have 'arrays' that have both the above features to some degree.

Where pupils are likely to need more of a traditional view of an array is in the A451 exam paper. My approach would be teach lists in Python and then when covering arrays discuss the differences and look at how this would look in pseudocode. At this point you can 'simulate' arrays with lists in Python by setting a starting size and asking pupils to solve problems without the use of append and pop.

<code>
names=[]

names=[""]*10 #Set starting size

names[3]='John'

names[7]='Peter'

print(names)

</code>

8. ### bangaioh

Indeed and at this level lists are just fine. In fact at AS lists are also completely fine to use!

I fail to see how anyone can read the OCR GCSE Computing spec and come up with Python as the language for this course.
Nothing wrong with Python, it has its place, but in GCSE Computing?

10. ### NotJohnBrown

Oh so true.

Bizarre obsession with Python (which, lets be honest, is ugly) and other languages when the answer, VB, is staring you right in the face.

Why make it so hard for the kids?

11. ### bangaioh

And that is why my school is doing the AQA spec!

12. ### ICT DonNew commenter

That's what I ended up planning to so. In reality the pupils will probably just use lists but I will show them both for reference, (and so they know the difference in the exam.)
Thanks for all the useful suggestions. It's always good to get the viewpoints of people who have delivered the course.

13. ### ICT DonNew commenter

It must just be me but I can't see the problem with Python syntax. I have used both languages with pupils for a series of lessons and didn't notice a difference in understanding or the speed at which they picked it up. Guess it's true what they say about old dogs and new tricks.
I don't mind VB and would also use it. The only reason I won't is so the focus will be on understanding program structures and instant results. For example:
or....

I like!

15. ### bangaioh

I have to say I don't get the python problems either. It's clean, teaches good layout, is easy to pick up, well documented and well supported.