My code works however believe my code should also include a else statement which simply outputs 1 in the case of x being 1 or 0. I can't work out how to include it without breaking my code. Adding the else and keeping the indentation on the return causes an unexpected indent whereas indenting the return means it simply executes after only one loop.
I'm sure it must have been covered earlier in the course but I can find any instances which match up with this one, the code below is what I have so far.
def factorial(x): total = x while x > 1: x = x-1 total = total * x return total