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

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -