Making comments in Python

Because of the fact that I don’t know how to make comments, I begun searching on the internet. I reached this site with a lot of information about commenting in Python. So, let’s follow the site and try to do that in Python. Btw, to make a black enter in python you can just type print(“\n”). Use that, because it makes the output of your script clearer. Okay, back to the comments. Comments are important to make explain what you are doing. In that way, it is possible that other people understand what you did and you also still can understand what you did if you look after a year or something again to your blog. I will add the comments on my script of my last blog.
– The first way to make comments at your blog is the easiest way, just use a hashtag (#). Every thing that you type behind the hashtag, at the same line, will be ignored during running the blog. So if you start on a new line, you need to put a new # in front of it.
– If you are to lazy to put on every new line a new #, you can also use three quote signs at the beginning and ending of your comment.
– If you select in Thonny a specific piece of script and press Ctr+3 you toggle comment the piece of text. So if not everything is a comment, you add a hashtag before every rule (so make a comment of every rule) and if everything already is a comment it erases the # everywhere (lines with at that moment two hashtags stay a comment). You also have Alt+3 and that adds a hashtag in front every selected line. The last option is Alt+4 and that erases a hashtag in front of every line.
The script were I ended with trying everything is this script. You can still see the hashtags and the quote signs.
Hopefully you learned something from this!


Plaats een reactie

Vul je gegevens in of klik op een icoon om in te loggen.

WordPress.com logo

Je reageert onder je WordPress.com account. Log uit /  Bijwerken )

Google photo

Je reageert onder je Google account. Log uit /  Bijwerken )

Twitter-afbeelding

Je reageert onder je Twitter account. Log uit /  Bijwerken )

Facebook foto

Je reageert onder je Facebook account. Log uit /  Bijwerken )

Verbinden met %s

Maak je eigen website aan bij WordPress.com
Aan de slag
%d bloggers liken dit: