Hey guys - could someone give me a hint as to what I can do to change my code to be correct for this factorial exercise? See below. I’m not sure if I need the for loop under the while loop, sort of hard to conceptualize. Any help is appreciated. Thanks.
def factorial(x): total = 0 while x-1 > 0: for n in x: total += n * (n-1) if x-1 <= 0: total = 1 return total