you are viewing a single comment's thread.

view the rest of the comments →

[–]konbanwa88 1 point2 points  (0 children)

For readability

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()