+1 vote
in Python by
import sys

def Factorial(n): # Return factorial

    result = 1

    for i in range (1,n):

        result = result * i

    print "factorial is ",result

    return result

Why?

IndentationError: unindent does not match any outer indentation level

1 Answer

0 votes
by
Other posters are probably correct...there might be spaces mixed in with your tabs. 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)

Related questions

0 votes
asked Oct 14, 2021 in Python by rajeshsharma
0 votes
asked Jan 11, 2021 in Python by SakshiSharma
...