Post

PythonPython

I
Irshad Mohammad

Posted on 25th April 2024|37 views

0
votes

Python Unindent Does Not Match Any Outer Indentation Level

How to resolve the error indentationError: unindent does not match any outer indentation level?

I don’t know why I am seeing this error please help me here is my code:

import sys 

def factorial(x): # Return factorial 

res = 1 

for j in range (1,x): 

res = res * j 

print "factorial is ",res

return res

 

Answers
P
jordan chris

Posted on 25th April 2024

Try this

import sys 

def factorial(x): # return factorial 

result = 1 

for j in range (1,x): 

res = res * j 

print "factorial is ",res

return res 

print Factorial(5)

 

Write your answer

STILL GOT QUERIES?

Get a Live FREE Demo
  • Explore the trending and niche courses and learning maps
  • Learn about tuition fee, payment plans, and scholarships
  • Get access to webinars and self-paced learning videos