Hint: You can adjust the default video playback speed in your account settings.
Hint: You can set the default subtitles language in your account settings.
Sorry! Looks like there’s an issue with video playback 🙁 This might be due to a temporary outage or because of a configuration issue with your browser. Please see our video player troubleshooting guide to resolve the issue.

How To Write Comments in Python

Give Feedback

In this lesson, you’ll learn how to write comments in Python. You’ll see that comments are made by putting a “#” symbol before a desired comment. The lesson will also show you how to spread comments over multiple lines as well as how to write comments quickly in your editor using shortcuts,

Rodrigo Vieira on March 13, 2019

Is the

"""Some module description

some module details

more common than

Some module description

some module details

I particularly prefer the second one. Have you poked around any big project’s source codes to see what is more common?

Dan Bader RP Team on March 13, 2019

@Rodrigo: According to PEP 257 (Docstring Conventions), the first variant ("""Text...) is preferred. But personally I like the second variant better where each """ block is on its own line. It just looks better to me :-)

Jackie Wilson RP Team on March 14, 2019

I think the second variant looks better (in code) also. But then again, I prefer camelCase vs underscores.

victorariasvanegas on June 13, 2019

I think the first variant looks good.

Dri on Oct. 9, 2019

Agree, the first variant looks much better

Become a Member to join the conversation.