Hi I am trying to do a recursive function for Pascal triangle to calculate a specific value in a given row , below is my code and I keep getting the following error :
TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'
My code so far:
def recursive_pascal(i,j):
if i == 0:
return 1
elif j == 1:
return 1
else:
recursive_pascal(i-1,j-1) + recursive_pascal(i-1,j)
print(recursive_pascal(3,2))