from sympy import * from sympy.functions.combinatorial.numbers import nC
p = nC(6,5) q = 5 r = factorial(5) p+q+r