I cannot figure out why this code is not working. I know it mightnot be the most elegant, but it should provide the result
def factorial(x):
if x==0 or x==1:
return 1
for i in x:
return fac


Great work on trying so far.

I think your for loop is problematic.

        for i in x:

This would throw following error:

TypeError: 'int' object is not iterable

So, X is not a list, it's of type Integer. Hence you cannot iterate Integer through for loop.
So, think of a way how could you keep reducing the integer value and keep multiplying until you reach 1.