Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def roll(tens,ones,TN):
- if tens == 10:
- result = ones
- if ones == 10:
- result = 100
- if tens != 10 and ones == 10:
- result = tens*10
- if tens != 10 and ones != 10:
- result = tens*10+ones
- SL = int(TN/10)-int(result/10)
- return SL
- def compare(TN):
- total = 0
- for t in range(1,11):
- for o in range(1,11):
- regularSL = roll(t,o,TN)
- flippedSL = roll(o,t,TN)
- total += max(regularSL,flippedSL)
- return total/100
- def averageSL(TN):
- total = 0
- for t in range(1,11):
- for o in range(1,11):
- regularSL = roll(t,o,TN)
- total+= regularSL
- return total/100
- for TN in range(1,101):
- print(compare(TN)-averageSL(TN))
Advertisement
Add Comment
Please, Sign In to add comment