Encountered "lili" at line 26, column 12. Was expecting one of: <NEWLINE>

来源:互联网 发布:支付宝源码 编辑:程序博客网 时间:2024/06/05 06:40

'''Created on 2017年8月1日'''class Person:    '''Person class Definition'''        population=0        def __init__(self,name):        self.name=name        print("init %s success" % (self.name))        Person.population += 1        def __del__(self):        print("del %s success" % (self.name))        Person.population -= 1            def fun_howMany(self):        return Person.population        def fun_saySth(self):        return "%s says something!" % self.name    if __name__=="__main__":    Person lili = Person('lili');    Person lucy = Person('lucy');    print(lili.fun_saySth());

Encountered "lili" at line 26, column 12. Was expecting one of:     <NEWLINE> ...     "(" ...     "[" ...     ";"  ...     "," ...     "." ...     "+" ...     "-" ...     "*" ...     "/" ...     "//" ...     "<<" ...     ">>" ...     "%" ...     "^" ...      "|" ...     "&" ...     "=" ...     ">" ...     "<" ...     "==" ...     "<=" ...     ">=" ...     "!=" ...     "+=" ...     "-="  ...     "*=" ...     "@=" ...     "/=" ...     "//=" ...     "%=" ...     "&=" ...     "|=" ...     "^=" ...     "<<=" ...      ">>=" ...     "**=" ...     "or" ...     "and" ...     "not" ...     "is" ...     "in" ...     "if" ...     "@" ...     ";" ...     ","  ...     

NOTE: 错误行改成这样:lili = Person('lili');

阅读全文
0 0
原创粉丝点击