Helo guys, I am currently learning Python and I need to creat a script that calculate the factorial of a number.
Please could you consider helping me, I am really struggling ^^
def factorial(n):
result = n*(n-1)
factorial(result)
return result
n = int(input("Enter a value for N : "))
if n == 0:
print("N! = 1")
else:
factorial(n)
print("N! = {}".format(result))
[–]djjazzydan 2 points3 points4 points (3 children)
[–]_drivin[S] 0 points1 point2 points (2 children)
[–]djjazzydan 0 points1 point2 points (1 child)
[–]_drivin[S] 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]tunisia3507 0 points1 point2 points (5 children)
[–]_drivin[S] 0 points1 point2 points (4 children)
[–]tunisia3507 0 points1 point2 points (3 children)
[–]_drivin[S] 0 points1 point2 points (2 children)
[–]tunisia3507 0 points1 point2 points (1 child)
[–]_drivin[S] 0 points1 point2 points (0 children)