β π Python World
π Biggest Number Wins
You can practise without a player, but pick a player to score points!
π The mission
Today you unlock
Functions return answers
A function is a tiny machine: it receives inputs, works something out, then returns one answer for the tests to check.
π‘ Hint ladder
- Python has a built-in max() function⦠or loop and compare!
- Loop version: keep a "best so far" and replace it when you find bigger.
π§ͺ Coach checks
- β― finds 9
- β― single number
- β― negatives too
- β― big list
Live coach
Getting ready
βββ
π¬ Python has helpful built-ins: max, min, sum, len.
numbers = [3, 9, 4] print(max(numbers)) # 9 print(min(numbers)) # 3 print(sum(numbers)) # 16 print(len(numbers)) # 3
π It printed:
Nice β you saw it work!
π Output
π§© Gaps filled! Ready to write it all yourself?