-6

i was actually adding a loop in my code and an error of " inconsistent use of tabs and spaces in indentation " with the line of " while ind<3242:"

So if you can help me, here is the code :

        ind=0
    X=[]
    Y=[]
    xtemp=[]   
    for i in x:
        r=open('DataSets/Corpus/'+i,'r')
        text=r.read()
        fin=text.split('^')
        for j in fin:
            while ind<3242:
                Y.append(str(i))
                xtemp.append(j)
                ind=ind+1
        r.close()

I checked the number of spaces and indentation and it looks the same actually. Thanks in advance !

  • 8
    Well there is an obvious indentation error in the first line of your code. If you're posting a question specifically about indentation, you really need to reproduce your indentation accurately. – khelwood Apr 05 '18 at 12:36
  • 4
    Possible duplicate of ["inconsistent use of tabs and spaces in indentation"](https://stackoverflow.com/questions/5685406/inconsistent-use-of-tabs-and-spaces-in-indentation) – Georgy Apr 05 '18 at 12:37
  • If anything `for i in x` is an error itself because `x` is not defined – OneCricketeer Apr 05 '18 at 12:40

1 Answers1

1

I checked the number of spaces and indentation and it looks the same

You need to check that you either always use spaces, or always use tabs. A tab may look like four spaces, but it isn't.

Ollie
  • 1,641
  • 1
  • 13
  • 31