ValueError: cannot convert n to int
I want to do the following
var('n')
prod([k for k in range(1,n)])
But I get the following error: ValueError: cannot convert n to int
Is there some way to do this that does not involve writing a for loop?
Are you trying to do a symbolic product? If
n
does not have a specific value then you won't getfactorial(n-1)
which I suppose is what you want.