Error
There was an error loading the page.
Metadata
-
England schools
-
England university
-
Scotland schools
Taxonomy: mathcentre
Taxonomy: Kind of activity
Taxonomy: Context
Contributors
History
Christian Lawson-Perfect 1 year, 10 months ago
Published this.Christian Lawson-Perfect 3 years, 1 month ago
Created this.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: assign x = 1. An alternative answer gives a hint if the studen'ts 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.
-
The student must write code to filter a given list of numbers, returning only the positive elements.
-
The student must write a list comprehension to map the elements of a given list.
-
This question shows how to use the programming extension's run_code function to run some Python code and use its result in the marking of a non-code part type. Python is used to calculate the correct answer for a number entry part type. This could be done
-
Asks the student to calculate the sum of the triangular numbers (up to some randomised number). Steps guide the student through each step in the calculation.
-
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.