Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 18fa58d

Browse files
cricket score with python
1 parent 9f9677a commit 18fa58d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

‎cricket_score.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# 12 8 5 6 3
2+
# You are given the numbers of 1 runs, 2 runs, 3 runs, fours and sixes scored by a batsman. Your task is to compute total run scored by that batsman.
3+
arr = input()
4+
5+
lst = list(map(int, arr.split(' ')))
6+
onse = lst[0]
7+
twos = lst[1]
8+
threes = lst[2]
9+
fours = lst[3]
10+
sixs = lst[4]
11+
12+
total = onse + twos*2 + threes*3 + fours*4 + sixs*6
13+
print(total)
14+
15+
# Test cases
16+
# https://oj.masaischool.com/status/5bd421ec6a482cbd78bb14853b679ecf

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /