You are viewing this question as it will appear in the manual grading interface. Return to the normal view when you are done.

Demo: Fibonacci function, file upload, external grading

This is a demo of using the Python autograder with an file upload interface. Note that if the student's uploaded filename is different than user_code.py then the correct filename should be set in student_code_file in the PLTestCase class. Here we set it to fib.py to match the file upload.

The Fibonacci numbers are 1, 1, 2, 3, 5, 8, ..., where each number is the sum of the two before it. These are numbered $F_1, F_2, \ldots$, and \[ F_n = F_{n-1} + F_{n-2}. \]

Write a Python function fib that takes a number n and returns the nth Fibonacci number, $F_n$.

Your code snippet should define the following variables:

Name Type Description
fib python function Function to compute the $n^\text{th}$ Fibonacci number
Files

Correct answer

Student view placeholder

In student views this area is used for assessment and score info.
Tools

Staff information

Question

Title:
Demo: Fibonacci function, file upload, external grading

Variant

Started at:
2026-08-04 23:37:43 (CDT)
Duration:
0s
Show/Hide answer
{}
History
dec frac
rad deg