def calcularBayes(priorA, probBdadoA, probB):
    return (priorA * probBdadoA) / probB


if __name__ == "__main__":
    probCancer = 1 / 10000
    probSintomaDadoCancer = 9990 / 10000
    probSintomaDadoNoCancer = 10 / 10000
    probNoCancer = 1 - probCancer

    probSintoma = (probSintomaDadoCancer * probCancer) + (probSintomaDadoNoCancer * probNoCancer)

    probCancerDadoSintoma = calcularBayes(probCancer, probSintomaDadoCancer, probSintoma)
    print(probCancerDadoSintoma)
    print(probSintoma)
def calcularBayes(priorA, probBdadoA, probB):
    return (priorA * probBdadoA) / probB


if __name__ == "__main__":
    probCancer = 1 / 10000
    probSintomaDadoCancer = 9990 / 10000
    probSintomaDadoNoCancer = 10 / 10000
    probNoCancer = 1 - probCancer

    probSintoma = (probSintomaDadoCancer * probCancer) + (probSintomaDadoNoCancer * probNoCancer)

    probCancerDadoSintoma = calcularBayes(probCancer, probSintomaDadoCancer, probSintoma)
    print(probCancerDadoSintoma)
    print(probSintoma)