1 Replies - 1408 Views - Last Post: 07 December 2015 - 11:01 AM Rate Topic: -----

#1 4salman7   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 06-December 15

IndentationError: unindent does not match any outer indentation level

Posted 07 December 2015 - 10:42 AM

Please Help!!
import math
def physics(th1, th2, d, mus, muk, s, m1, m2, t1, t2):
    g = 9.8
    fk1 = m1*float(g)*muk*math.cos(th1*(math.pi/180))
    fk2 = m2*float(g)*muk*math.cos(th2*(math.pi/180))
    th1 > 0 and th1 < 90
    th2 > 0 and th2 < 90
    mus > muk
    x = (d*(math.tan(th2*(math.pi/180)))/(math.tan(th1*(math.pi/180)) + math.tan(th2*(math.pi/180))))
    y = float(x)*(math.tan(th1*(math.pi/180)))
    a = math.sqrt((float(y)**2) + (float(x)**2))
    b = math.sqrt((float(y)**2) + ((10-float(x))**2))
    Fg1 = m1*float(g)*math.sin(th1*(math.pi/180))
    fs1 = m1*float(g)*mus*math.cos(th1*(math.pi/180))
    Fg2 = m2*float(g)*math.sin(th2*(math.pi/180))
    fs2 = m2*float(g)*mus*math.cos(th2*(math.pi/180))
    if float(Fg1) - float(Fg2) > 0:
        FR1 = float(Fg1) - float(fs1)
        FR2 = float(Fg2) + float(fs2)
	return float(FR1) - float(FR2)
	FRT = math.fabs(float(FR1) - float(FR2))
    aT = (float(FRT))/(m1 + m2)
    s1 = (float(aT)*float(t1)**2)/2
    if t1 >= 0 and t1 <= (s / float(aT))**0.5:
	    aT = aT
    elif t1 > (s / float(aT))**0.5:
	    aT = 0	
    if float(Fg1) - float(Fg2) > 0:
	    x1 = float(a) - 0.1 - (s/2) - float(s1)
        x2 = float(b) - 0.1 - (s/2) + float(s1)
    elif float(Fg2) - float(Fg1) > 0:
	    x2 = float(b) - 0.1 - (s/2) - float(s1)
    	x1 = float(a) - 0.1 - ((s/2)-float(s1))
    s + 0.1 < float(a)
    t2 > 0
    N1 = float(Fg1) - float(fk1)
    N2 = float(Fg2) - float(fk2)
    aN1 = (float(N1))/(m1)
    aN2 = (float(N2))/(m2)
    tN1 = ((2*float(x1))/float(aN1))**0.5
    tN2 = ((2*float(x2))/float(aN2))**0.5   
    t = t1 + t2
    print "t = %f s, x1 = %f m, x2 = %f m" % (float(t), float(x1), float(x2))


ERROR:
File "python", line 30
x2 = (float(b) - 0.1 - (s/2) + float(s1))
^
Indentationerror: unindent does not match any outer indentation level

* ERROR:
File "python", line 30
x2 = (float(B) - 0.1 - (s/2) + float(s1))
........................................^
Indentationerror: unindent does not match any outer indentation level

**ERROR:
File "python", line 30
x2 = (float(B)/> - 0.1 - (s/2) + float(s1))
..........................................^
Indentationerror: unindent does not match any outer indentation level


*the text editor of this website sucks!!*
the '^' is under the last ')' in the error

Is This A Good Question/Topic? 0
  • +

Replies To: IndentationError: unindent does not match any outer indentation level

#2 andrewsw   User is offline

  • never lube your breaks
  • member icon

Reputation: 6833
  • View blog
  • Posts: 28,342
  • Joined: 12-December 12

Re: IndentationError: unindent does not match any outer indentation level

Posted 07 December 2015 - 11:01 AM

Even though it doesn't look like it in your posted code, line 30 is indented to a different level than line 31.

Make sure that you consistently use either tabs or four spaces, you should be able to configure you editor to handle this for you.

This post has been edited by andrewsw: 07 December 2015 - 11:02 AM

Was This Post Helpful? 1
  • +
  • -

Page 1 of 1