IndentationError: unindent does not match any outer indentation level, although the indentation looks correct

One possible cause for this error is that there might be spaces mixed with tabs for indentation. Try doing a search & replace to replace all tabs with a few spaces.

Try this:

import sys

def Factorial(n): # return factorial
    result = 1
    for i in range (1,n):
        result = result * i
    print "factorial is ",result
    return result

print Factorial(10)

Leave a Comment