Error
There was an error loading the page.
This exam collects some questions demonstrating different uses of the programming extension and the Code part type, to mark code written in Python and R.
Metadata
-
England schools
-
England university
-
Scotland schools
Taxonomy: mathcentre
Taxonomy: Kind of activity
Taxonomy: Context
Contributors
Feedback
From users who are members of Demos :
![]() |
said | Ready to use | 3 years, 1 month ago |
History
Christian Lawson-Perfect 3 years, 1 month ago
Published this.Christian Lawson-Perfect 3 years, 1 month ago
Gave some feedback: Ready to use
Christian Lawson-Perfect 3 years, 1 month ago
Created this as a copy of Programming extension demo.Name | Status | Author | Last Modified | |
---|---|---|---|---|
Programming extension demo | draft | Christian Lawson-Perfect | 11/05/2023 15:56 | |
Programming extension demo | Ready to use | Christian Lawson-Perfect | 21/06/2023 08:16 |
There are 10 other versions that do you not have access to.
-
This is the simplest demonstration of the "code" part type I could think of: write Python to assign x = 1. An alternative answer gives a hint if the student's code doesn't define x at all.
-
The student must write code to compute the standard deviation of an unknown list of measurements. The suggested answer uses numpy.std.
-
Given a randomly-generated list, the student must write code to return its first value. There's an alternative to check if they get the second item, which they might do if they don't realise Python lists are zero-indexed.
-
Given an unknown list, the student has to write code to return the last item in the list.
-
Given an unknown list, the student must write Python code to create a copy of it. There's an alternative to catch the case where the student's variable is just a reference to the original list.
-
This question shows how to display a plot generated in matplotlib from code written by the student.
-
In four parts, the student builds up the definition of a class representing a rectangle. First they write the constructor, then add methods to compute area and perimeter. In the final part, they must use the methods to write a function which determines if a rectangle's area is larger than its perimeter.
Topics
No topics have been defined.