Total Runs in an Over
Programs with input · Beginner · about 5 min
A cricket over has six balls. Read the runs scored off each ball: six whole numbers, one per line. Print the total as Total runs: 14. If the total is 0, print Maiden over on the next line.
The prompts inside input() are not checked, only what you print.
Examples
You type:
1 4 0 6 2 1
The program prints:
Total runs: 14
You type:
0 0 0 0 0 0
The program prints:
Total runs: 0 Maiden over
runs = int(input("Runs off ball 1: "))
# Read the other five balls, add them up and print the total
The solution opens after your first Check.