def combination(n, r):
if n == r or r == <NUM_LIT:0>:<EOL><INDENT>return <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>return combination(n-<NUM_LIT:1>, r-<NUM_LIT:1>) + combination(n-<NUM_LIT:1>, r)<EOL><DEDENT>
This function calculates nCr.