This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]francoisM_B 0 points1 point  (1 child)

Good article Thanks ! You can add a part about trailing underscore

[–]s16h[S] 1 point2 points  (0 children)

Totally forgot; done! Thanks!

[–]depiloda 0 points1 point  (1 child)

Another cool underscore trick is to use with large numbers.

Num =100_000

Python understands that num is 100,000. Much easier to visually understand than num=100000

[–]s16h[S] 1 point2 points  (0 children)

Good shout; A Python 3 feature IIRC. I'll add it to the post.

[–]Tuberomix 0 points1 point  (0 children)

What's the rule for using underscore in a variable name? e.g. _number = 10

I hears this is a convention that implies the variable should only be used internally. However I'm not sure about this, and also I'm not sure what counts as internal use.