Way to create multiline comments in Python? -
i have started studying python, couldn't find how implement multi-line comments. languages have block comment symbols
/* */ i tried in python, throws error, not correct way. python have multiline comment feature?
you can use triple-quoted strings. when they're not docstring (first thing in class/function/module), ignored.
''' multiline comment. ''' (make sure indent leading ''' appropriately avoid indentationerror.)
guido van rossum (creator of python) tweeted this "pro tip".
however, python's style guide, pep8, favors using consecutive single-line comments, , you'll find in many projects. editors have shortcut easily.
Comments
Post a Comment