Quiz points
Write code · Basic · §10.1 Recursion that repeats work
In a live-stream quiz event, you get 2 points for each easy question you answer correctly and 3 points for each hard question you answer correctly. You can answer any number of questions correctly.
Suppose you write down the points of the questions you answer correctly, in the order you answer them. Complete the function solution, which returns the number of such lists whose total is exactly n points. The same points in a different order make a different list. For example, there are two ways to make 5 points: 2 then 3, and 3 then 2. If you cannot score exactly n points, return 0.
Function
solution(n)
Constraints
nis an integer from 1 to 100.- The answer can be a very large number. Return it as a Python integer as it is, without taking a remainder.
Examples
| n | result |
|---|---|
7 | 3 |
10 | 7 |
Starter code
def solution(n):
answer = 0
return answerSolve this problem in your browser
Python runs in your browser and checks your answer right away. Hints and the answer are on the problem page.