For this Question: For a certain event, the value of a favorable outcome is A and the total outcome is B. If the probability of this event is represented by p/q where p and q are coprime then what will be the value of p+q.<b>User Task:</b>
Since this will be a functional problem, you don't have to take input. You just have to complete the function <b>Probability()</b> that takes integers A, and B as arguments.

Constraints:-
1 <= A <= B <= 10000Return the value of p+q.Sample Input:-
4 6

Sample Output:-
5

Sample Input:-
3 5

Sample Output:-
8, I have written this Solution Code: def Probability(A,B):
    x=1
    for i in range (2,A+1):
        if (A%i==0) and (B%i==0):
            x=i
    A=A//x
    B=B//x
    return A+B
    , In this Programming Language: Python, Now tell me if this Code is compilable or not?