online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
def fact2(x): if x < 0: return ValueError("number of successes cannot be less than 1") else: fact = 1 for i in range(1, x + 1): fact = fact * i return fact def combination2(n, x): if x > n: raise ValueError('the number of success cannot be greater than the number of trials') return(fact2(n)/fact2(n-x)*fact2(x)) #define x and n here n = 6 x= 5 p =.1 print("The probability of x successes, followed by the total number of arrangements/possible combinations used to find x:") print(combination2(n, x) * (p)**(x) * ((1-p)**(n-x)))

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue