I have been for some time writing a function which relies on many other to return an answer. When I finished it, it stated I had wrongly used the "*" somewhere. I went through everything and could not see a problem. I finally found that it was because of a simple factorial function earlier defined, as shown below:
if n == 0:
return 1
elif n < 0 or (type(float)):
print "%s is an invalid input; Positive integer value is required" % (n)
else:
return (n)*fact(n-1)
However if I enter n = 6, it returns that 6 is a floating number, and thus exits the rest of the function, and I hope someone can answer why this is happening and how to get around it.
Many Thanks
type(float)returns a type, so it's always true - Maxime Lorant