Skip to content
← Back to Community
tabs and spaces
Profile icon
inyourface3445

is there a regular expression that will only find spaces and not tabs? The ettor is yelling at me to fix inconsistent tabs and spaces.

Answered by Bookie0 [earned 5 cycles]
View Answer
Voters
Profile icon
GlitchRed
Profile icon
inyourface3445
Comments
hotnewtop
Profile icon
Bookie0

Indent and unindent everything by pressing on mac cmd-a (select everything) then tab (to indent) and then shift-tab (to unindent). On windows, do ctrl-a, tab, and shift-tab.

Then it should work! :D

Profile icon
RYANTADIPARTHI

Solution

to fix that, it is easy. all you have to do is unindent everything, and indent them back again:

def make_passABC(): z = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M','N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'] langth = int(input('how log will the string be')) for i in range(0, langth): d = len(z)

and indent it again. back to normal:

def make_passABC(): z = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M','N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'] langth = int(input('how log will the string be')) for i in range(0, langth): d = len(z)

like that.
That should work

Profile icon
inyourface3445

@RYANTADIPARTHI but i have a lot of functions in my code. is there an easier way to do this?

Profile icon
RYANTADIPARTHI

@inyourface3445 no, you don't have to indent everything. only 1 or 2 lines near the error. your error is on line 95. so unindent line 95, 96, 97, and 94, 93. that's it.

Also, another way is to comment the error part, and write that part again.