Python中的注釋有單行注釋和多行注釋:
python中單行注釋以#開頭,例如:
#這是一個注釋 print("hello,word!")
多行注釋用三個單引號‘’‘或者三個雙引號"""將注釋括起來例如:
1、單引號(''')
#!/usr/bin/python3 ''' 這是多行注釋,用三個單引號; 這是多行注釋,用三個單引號; 這是多行注釋,用三個單引號; ''' print("hello ,python3")
2、雙引號(""")
#!/usr/bin/python3 """ 這是多行注釋,用三個雙引號; 這是多行注釋,用三個雙引號; 這是多行注釋,用三個雙引號; """ print("hello,python3!")