Got stuck


#1

def factorial(x):
if x==1 or x==0:
return 1
else:
for char in x:

INSTRUCTIONS:

Define a function factorial that takes an integer x as input.

Calculate and return the factorial of that number.

PROBLEM:
i dont know how to express that x has to be multiplied by (x-1)(x-2)…etc.


#2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.