Lists and collections · Python exercise
Compute the mean of a line of integers and format it to two decimals.
Read one line of space-separated integers and print their average with exactly two digits after the decimal point.
Example 1
Input
1 2 3 4
Output
2.50
Example 2
Input
10 20
Output
15.00
How testing works
Your code runs once per test case with that case's standard input. Output is compared after normalising trailing spaces and blank lines at the end. Use input() without a prompt when the exercise expects clean output.
Loading editor…
Press Run tests to execute your code against every input case. Python runs in a Web Worker in your browser.