Newbie: unexpected indenting error

Martin S shieldfire at gmail.com
Sun Jul 13 03:01:12 EDT 2014


While coding a rating calculator I am using a for-loop within if-elif-else.
When using the for-loop in the first if instance my editor accepts
this, but when using the same for-loop within the elif instance it
complain about "unexpected indent".

Like so:

def function(x):
   if rdiff >=500:
      for ....
         [do stuff]
   elif rdiff >=410:
       for ...                      <== unexpected indent
          [do other stuff]


What the...? What am I doing wrong?
(hopefully the indents translate; else def, if/elif, for and [dostuff]
are indented)

/Martin S
-- 
Regards,

Martin S



More information about the Python-list mailing list