Recently published items
-
R vectors
QuestionThe student must write R code to define vectors, in a few ways.
Published on 10/05/2023 12:32 CC BY -
Assign a variable
QuestionThe student must write R code to assign the given value to the variable
x.Published on 10/05/2023 12:32 CC BY -
Exploration activity: Define a class, add methods to it, then use it
QuestionIn 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.
Published on 10/05/2023 12:32 CC BY -
Make a plot with matplotlib
QuestionThis question shows how to display a plot generated in matplotlib from code written by the student.
Published on 10/05/2023 12:31 CC BY -
Sum of triangular numbers (with optional steps)
QuestionAsks 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.
Published on 10/05/2023 12:31 CC BY -
Get Python to work out the right answer
QuestionThis 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
Published on 10/05/2023 12:31 CC BY -
List comprehension
QuestionThe student must write a list comprehension to map the elements of a given list.
Published on 10/05/2023 12:31 CC BY -
Filter a list
QuestionThe student must write code to filter a given list of numbers, returning only the positive elements.
Published on 10/05/2023 12:30 CC BY -
Make a copy of a list
QuestionGiven 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.
Published on 10/05/2023 12:29 CC BY -
Get the last item in a list
QuestionGiven an unknown list, the student has to write code to return the last item in the list.
Published on 10/05/2023 12:29 CC BY