Welcome to Admin Junkies, Guest — join our community!

Register or log in to explore all our content and services for free on Admin Junkies.

Python How to Comment

Jason

Royal member
Bronze Member
Joined
Nov 3, 2022
Messages
1,446
Website
drummerlesson.com
Credits
31
Python has three ways to comment. The first way is only for a single line. You use the (#) for that. The 2nd and third ways allow for comments on more than one line without having to make a combo of one or more hashtags.

Let's say I want comment on a single line.

Code:
# This place is Admin Junkies.

Next, let's try the 2nd way.

Code:
""" This is a Admin Junkies.
It has a coding section.
Why not try it out?
Are you up to it? """

Finally, here is the last way:

Code:
# This is Admin Junkies. \
It has more than one theme \
Which ones do you like? \
Why is that the case?

O.K. what comment form do you like and why?
 
I like a lot of short oneliners in the middle of functions/methods to annotate why something is so, and I like a good multiline comment with triple quotes for the function description.

Single line with escapes, ew.

Then again I'm so much happier with C conventions - // for single line, /* ..... */ for multi line.
 

Log in or register to unlock full forum benefits!

Log in or register to unlock full forum benefits!

Register

Register on Admin Junkies completely free.

Register now
Log in

If you have an account, please log in

Log in
Activity
So far there's no one here

Users who are viewing this thread

Would You Rather #9

  • Start a forum in a popular but highly competitive niche

    Votes: 5 21.7%
  • Initiate a forum within a limited-known niche with zero competition

    Votes: 18 78.3%
Win this space by entering the Website of The Month Contest

Theme editor

Theme customizations

Graphic Backgrounds

Granite Backgrounds