loading

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.11620362003836426","path":"main.py","file":{"path":"main.py","content":{"asEncoding":{"base64":"aW1wb3J0IG1hdGgKCmRlZiBuQ3IobixyKToKICBmID0gbWF0aC5mYWN0b3JpYWwKICByZXR1cm4gZihuKSAvLyBmKHIpIC8vIGYobi1yKQoKZGVmIGNhbGN1bGF0ZV9tdWx0aXBsaWVyKG1pbmVzLCBkaWFtb25kcyk6CiAgaG91c2VfZWRnZSA9IDAuMDEKICByZXR1cm4gKDEgLSBob3VzZV9lZGdlKSAqIG5DcigyNSwgZGlhbW9uZHMpIC8gbkNyKDI1IC0gbWluZXMsIGRpYW1vbmRzKQoKd2hpbGUgVHJ1ZToKICBtaW5lcyA9IGludChpbnB1dCgiRW50ZXIgbnVtYmVyIG9mIG1pbmVzOiIpKQogIGRpYW1vbmRzID0gaW50KGlucHV0KCJFbnRlciBudW1iZXIgb2YgZGlhbW9uZHM6IikpCiAgbXVsdGlwbGllciA9IGNhbGN1bGF0ZV9tdWx0aXBsaWVyKG1pbmVzLCBkaWFtb25kcykKICAKICBwcmludCgiTXVsdGlwbGllcjogezA6LjJmfSIuZm9ybWF0KG11bHRpcGxpZXIpKQo="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import math

def nCr(n,r):
  f = math.factorial
  return f(n) // f(r) // f(n-r)

def calculate_multiplier(mines, diamonds):
  house_edge = 0.01
  return (1 - house_edge) * nCr(25, diamonds) / nCr(25 - mines, diamonds)

while True:
  mines = int(input("Enter number of mines:"))
  diamonds = int(input("Enter number of diamonds:"))
  multiplier = calculate_multiplier(mines, diamonds)
  
  print("Multiplier: {0:.2f}".format(multiplier))