• Register
0 votes
92 views

Problem :

When I compile the Python code I get below error

IndentationError: unindent does not match any outer indentation level

6 5 3
6,930 points

1 Answer

0 votes

Solution 

For Sublime Text users:

Set Sublime Text to use tabs for indentation: 

View --> Indentation --> Convert Indentation to Tabs

Uncheck the Indent Using Spaces option as well in the same sub-menu above. 

This will immediately resolve this issue.

Further Readings:

https://github.com/funkandwagnalls/pythonpentest/issues/1

9 7 4
38,600 points

Related questions

0 votes
1 answer 60 views
60 views
PROBLEM: Python programming is new to me . I wrote a code which gives me following error: python indentationerror: unindent does not match any outer indentation level The code I wrote is: import sys def Function(x): result = 1 for i in range (1,x): result = result * i * i print ("Your factorial is ",result) return result print (Function(10))
asked Mar 18 LizzyM 6.1k points
0 votes
1 answer 118 views
118 views
Problem : When I try to compile my Python code below, I get below error “IndentationError: unindent does not match any outer indentation level” import sys def Factorial(n): # Return the factorial     myresult = 1     for j in range (1,n):         myresult = myresult * j     print "The factorial is: ",myresult     return myresult Why am I getting above error?
asked Jan 22 jwilliam 3.9k points
1 vote
1 answer 28 views
28 views
Problem: For my project I wrote this code: def create_train_data(): trainday_data = [1100] for img in tqdm(os.listdir(TRAIN_DIR)): label = label_img(img) path = os.path.join(TRAIN_DIR, img) training_data.append([np.array(img), np.array(label)]) ... np.save('train_data.npy', training_data) ^ IndentationError: unindent does not match any outer indentation level Please help me to fix this poblem.
asked Apr 7 LizzyM 6.1k points
0 votes
1 answer 26 views
26 views
Problem: I am new to python and I have implemented the list in python and trying to access the list index but it getting me an error that is intend error by for loop don’t know what I am doing wrong in this code. I come from the C background so ... File "main.py", line 46 break ^ IndentationError: unindent does not match any outer indentation level Need someone to help me waiting for help!!
asked Jun 29 Gavin 15.3k points
0 votes
1 answer 26 views
26 views
Problem: I am a newbee in python programming. I was doing my coding practice. I wrote some codes like : class MyCar: def __init__(self,rang,oil_remaining,**kwargs): self.rang=rang self.fuel_remaining=oil_remaining self.taps = 0 for key,value in kwargs.items(): setattr(self ... and spaces in indentation The code seems right to me but I dont know why am I getting this type of errors. Please help me
asked Mar 22 LizzyM 6.1k points