Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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?