Iterative Approach to Solving Factorials | thiscodeWorks

PHOTO EMBED

Tue Aug 03 2021 03:58:28 GMT+0000 (Coordinated Universal Time)

Saved by @mdcx #python

def getFactorialit (n):
	if n < 0, return -1
    else fact = 1
    for i in range (1, n +1):
    	fact *=i
    return fact
    
print getFactorialit(10)
content_copyCOPY

https://www.thiscodeworks.com/5f7240b5a7ff620014975daa