logo-MindMajix
PostPythonPython
I
Irshad Mohammad

Posted on 20th July 2024|39 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

 

1 answers
Answers
P
jordan chris

Posted on 20th July 2024| views

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
Name
Course *
Email *
Phone Number