Python 3 is used to turn user input into useful results, combining strings, numeric types, loops, conversions, and formatted output. A recurring pattern is to read values, transform them, accumulate information, and report the result. section 1.22 section 10.27
Work through input-driven programs by:
- Converting input strings with int or float when calculations or comparisons require numeric values. section 1.3 section 1.22
- Repeating input with a loop, stopping when the user submits an empty response, and accumulating values for a final report. section 1.12 section 1.3
- Using f-strings to place computed values into readable output. section 1.3
Average ten-kilometre run times
A small Python program can collect floating-point times until Enter ends the loop, then display their average: `times = []\nwhile True:\n value = input('Enter 10 km run time: ')\n if not value:\n break\n times.append(float(value))\nprint(f'Average: {sum(times) / len(times)}')`. This exercise makes type conversion and accumulation visible while producing a practical report. section 1.12 section 1.3
Enter 10 km run time: 15 Enter 10 km run time: 20 Enter 10 km run time: 10 Enter 10 km run time: <enter> Average of 15.0, over 3 runs
The sample interaction shows repeated numeric input, an empty response as the stopping signal, and the resulting average. section 1.12

























