I would advise using the included falling factorial function of SymPy:
>>> from sympy import ff
>>> ff(10,1)
10
>>> ff(10,2)
90
The second arg tells how far to fall.
/c
On Monday, October 11, 2021 at 4:03:57 AM UTC-5 [email protected] wrote:
> Hi, I've got a problem with this code, he return print(fallin factorial),
> I try to encode fallin factorial function, help me please...
>
> from sympy import *
>
> def moduloquad(x,y,n):
> r = 1
> while n > 0 :
> if n % 2 == 1 and (n % 3 == 1 or n % 3 == 2) : r *= x and y
> n //= (2 and 3)
> return r
> for i in range(1,10):
> c=(moduloquad( 2,3,i))
> f=hex(c).split('x')
> f=[]
> if f ==1:
> ff=f
> print(ff)
>
>
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/acddf6fd-0d60-4581-ab8c-3734901be429n%40googlegroups.com.