+ 1
I want to print array of factorial of a number.Why my program is showing error?
def factorial(n): fact = [1] for i in range(1,n+1): return fact.append(fact[(i-1)]*i) n = input() print (factorial(n))
2 Réponses
+ 1
Mainly your function is factorial, not fact. Search for recursivity, see examples and try solving again
0
Don't use so many tags please. 3-5 tags are optimal.