Magzter Gold (Sitewide CA)
Raspberry Pi Coding & Projects The Complete Manual (Digital)

Raspberry Pi Coding & Projects The Complete Manual (Digital)

1 Issue, Issue 6

Also available on
Zinio Unlimited logo
1-month free trial

Get unlimited access to this article, this issue, + back issues & 5,000+ other magazines.

Renews at just $8.99/month after trial.

Cancel anytime.
Learn more

Using Comments

When writing your code, the flow, what each variable does, how the overall program will operate and so on is all inside your head. Another programmer could follow the code line by line but over time, it can become difficult to read.
Using Comments
#COMMENTS! Programmers use a method of keeping their code readable by commenting on certain sections. If a variable is used, the programmer comments on what it’s supposed to do, for example. It’s just good practise. STEP 1 Start by creating a new instance of the IDLE Editor (File > New File) and create a simple variable and print command: Save the file and execute the code. STEP 2 Running the code will return the line: The value of A is, 10 into the IDLE Shell window, which is what we expected. Now, add some of the types of comments you’d normally see within code: STEP 3 Resave the code and execute it. You can see that the output in the IDLE Shell is still the same as before, despite the…
You're reading a preview of
Raspberry Pi Coding & Projects The Complete Manual (Digital) - 1 Issue, Issue 6

DiscountMags is a licensed distributor (not a publisher) of the above content and Publication through Zinio LLC. Accordingly, we have no editorial control over the Publications. Any opinions, advice, statements, services, offers or other information or content expressed or made available by third parties, including those made in Publications offered on our website, are those of the respective author(s) or publisher(s) and not of DiscountMags. DiscountMags does not guarantee the accuracy, completeness, truthfulness, or usefulness of all or any portion of any publication or any services or offers made by third parties, nor will we be liable for any loss or damage caused by your reliance on information contained in any Publication, or your use of services offered, or your acceptance of any offers made through the Service or the Publications. For content removal requests, please contact Zinio.

© 1999 – 2025 DiscountMags.com All rights reserved.