def F(n):
if n > 2:
return G(n - 2)
def G(n):
if n > 1:
return F(n - 1) + n
print(F(8))
Traceback (most recent call last):
File "main.py", line 127, in <module>
print(F(8))
File "main.py", line 119, in F
return G(n - 2)
File "main.py", line 124, in G
return F(n - 1) + n
File "main.py", line 119, in F
return G(n - 2)
File "main.py", line 124, in G
return F(n - 1) + n
TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'