Python3注釋


Python中的注釋有單行注釋和多行注釋:

python中單行注釋以#開頭,例如:

#這是一個注釋
print("hello,word!")

多行注釋用三個單引號‘’‘或者三個雙引號"""將注釋括起來例如:

1、單引號(''')

#!/usr/bin/python3
'''
這是多行注釋,用三個單引號;
這是多行注釋,用三個單引號;
這是多行注釋,用三個單引號;
'''
print("hello ,python3")

2、雙引號(""")

#!/usr/bin/python3
"""
這是多行注釋,用三個雙引號;
這是多行注釋,用三個雙引號;
這是多行注釋,用三個雙引號;
"""
print("hello,python3!")

 


免責聲明!

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



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