def lattice_moves(n, m, l):
if n==0 and m==0 and l==0:
return 1
elif n==0 and m==0:
return (lattice_moves(n, m, (l-1)))
elif n==0 and l==0:
return (lattice_moves(n, (m-1), 1))
elif m==0 and l==0:
return (lattice_moves((n-1), m, l))
elif n==0:
return (lattice_moves((n, m-1, l)))+(lattice_moves(n, m, (l-1)))
elif m==0:
return (lattice_moves(((n-1), m, l)))+(lattice_moves(n, m, (l-1)))
elif l==0:
return (lattice_moves(((n-1), m, l)))+(lattice_moves(n, (m-1), l))
else:
return (lattice_moves(((n-1), m, l)))+(lattice_moves(n, (m-1), l))+(lattice_moves(n, m, (l-1)))
print(lattice_moves(2, 2, 2))
I keep getting the error "
Error:
File "C:\Users\gc2190\untitled0.py", line 34, in lattice_moves
return (lattice_moves(((n-1), m, l)))+(lattice_moves(n, (m-1), l))+(lattice_moves(n, m, (l-1)))
TypeError: lattice_moves() missing 2 required positional arguments: 'm' and 'l'", can anyone see a way to fix it?