← My dashboard
PUZZLE 004
The grade function
Python · Module 1 · Functions · if+100 XP
Professor Owl
Teach the Academy to grade by itself.
Instead of writing the same decision again and again, write a function. Once it exists, you can use it with any grade.
Goal
Write a function classify(grade) that returns "Outstanding" if the grade is 9 or more, "Pass" if it is 5 or more, and "Fail" otherwise.
Key facts
- def name(parameter): starts a function
- return sends back the answer
- if / elif / else choose between options
main.py⏳ Loading Python… (the first time takes a few seconds)
What your code produced
Run your code and the result will appear here.
🎯 You solve it when your code produces what the goal asks for.