IndentationError: unexpected unindent WHY?

后端 未结 4 1197
盖世英雄少女心
盖世英雄少女心 2021-01-01 09:10

IndentationError: unexpected unindent WHY???

#!/usr/bin/python
import sys
class Seq:
    def __init__(self, id, adnseq, colen):
        self.id     = id
             


        
4条回答
  •  一整个雨季
    2021-01-01 09:25

    This error could actually be in the code preceding where the error is reported. See the For example, if you have a syntax error as below, you'll get the indentation error. The syntax error is actually next to the "except" because it should contain a ":" right after it.

    try:
        #do something
    except
        print 'error/exception'
    
    
    def printError(e):
        print e
    

    If you change "except" above to "except:", the error will go away.

    Good luck.

提交回复
热议问题