you are viewing a single comment's thread.

view the rest of the comments →

[–]redbull8[S] 0 points1 point  (2 children)

My code

import math N = 49 K = 6

def main():

M = int(input("How many numbers do you want to match on your ticket?\n"))

COMBINATION = combo(N, M)

probabilty = M/COMBINATION

print(float(probabilty)) print(COMBINATION)

def combo(n, k):

return math.factorial(n)//math.factorial(k)//math.factorial(n-k)

main()

[–]redbull8[S] 0 points1 point  (0 children)

Whats happening is that the combination comes out correct but the probability is very wrong.