SQLDAXExcelPython
Leaderboard
Core PythonMedium20 points

Find the missing number

A list holds the numbers from 1 to n with one missing, in any order. Complete missing_number(numbers) so it returns the missing one.

How your answer is tested

After your code, this runs and its result is checked:

result = [missing_number([1, 2, 4, 5]), missing_number([2]), missing_number([3, 1])]
Show solutionLifetime

Real Python running in your browser through Pyodide, with pandas available. Nothing you type is sent to a server unless you save a score.

Python
Loading editor…

Press Ctrl+Enter or Run to see the result here.