Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- import fractions
- # current & required run rate
- # ----------------------------
- # runBall = ['300 294 6', '200 100 100', '333 250 40', '118 100 180']
- # def check(i):
- # toli = i.split(' ')
- # toInt = list(map(int, toli))
- # totalBall = 300
- # ballInOver = 6
- # oppositionRun = toInt[0]
- # currentRun = toInt[1]
- # remainingBall = toInt[2]
- # ballfaced = totalBall - remainingBall
- # remainingOver = ballfaced / ballInOver
- # currentRunRate = currentRun / remainingOver
- # runRequire = (oppositionRun + 1) - currentRun
- # requireRunRate = (runRequire/remainingBall)*6
- # print(round(currentRunRate, 2), end=' ')
- # print(round(requireRunRate, 2), end=' ')
- # for i in runBall:
- # check(i)
- # print('\n')
- # factorial
- # -----------
- # x = [6, 10, 15]
- # def check(i):
- # print(math.factorial(i), end=' ')
- # print('\n')
- # for i in x:
- # check(i)
- # alt elements ( the element one after another )
- # -----------------------------------------------
- x = [[1, 4, 55, 66, 22, 0, 76, 11, 23, 78], [1, 2, 3, 4, 5]]
- count = 0
- def check(i):
- for m, o in enumerate(i, start=1):
- if m % 2 != 0:
- print(o, end=' ')
- print('\n')
- for i in x:
- count += 1
- print('set ', count, ': ', end=' ')
- check(i)
Advertisement
Add Comment
Please, Sign In to add comment