Python成功解决IndentationError: unindent does not match any outer indentation level

class Chinese:

    def __init__(self,hometown,region):
        self.hometown = hometown
        self.region = region
        print('程序持续更新中……')

    def born(self):
        print('我生在%s。'%(self.hometown))

    def live(self):
        print('我在%s。'%(self.region))

    def main(self):
        self.born()
        self.live()
 a=Chinese('A','B')
a.main()

报错描述

a=Chinese('A,‘B’)
a.main()
IndentationError: unindent does not match any outer indentation level

解决办法

新手常见问题,观察缩进问题a=Chinese('A','B')应该对齐a.main()

上一篇:Javascript非构造函数的继承


下一篇:SQL基础