编程语言
首页 > 编程语言> > Python成功解决IndentationError: unindent does not match any outer indentation level

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()

标签:unindent,outer,Chinese,level,hometown,self,main,region,def
来源: https://blog.csdn.net/weixin_44991673/article/details/109955575