Python注釋縮進不得當導致IndentationError: unexpected indent


def test():
    i=0
'''
aaaaaa
'''
    while i < 5:
    '''
    bbbbbb
    '''        
        print(i)
        i+=1
        
if __name__ == '__main__':
    test()

如上,Python注釋的縮進不得當,也會導致IndentationError: unexpected indent。將注釋的縮略修改如下后解決。

def test():
    i=0
    '''
    aaaaaa
    '''
    while i < 5:
        '''
        bbbbbb
        '''        
        print(i)
        i+=1
        
if __name__ == '__main__':
    test()

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM