Magzter Gold (Sitewide Promotion)
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

Working with Variables

Variables are where all the action takes place in your code. A Variable can be anything, from the number of lives in a game, that changes as you progress through the game, to a person’s name, age and address. Variables can be static or alter depending on what you want the code to do.
Working with Variables
VARIOUS VARIABLES You’ll be working with the Python 3 IDLE Shell in this tutorial. If you haven’t already, open Python 3 or close down the previous IDLE Shell to clear up any old code. STEP 1 In some programming languages you’re required to use a dollar sign to denote a string, which is a variable made up of multiple characters, such as a name of a person. In Python this isn’t necessary. For example, in the Shell enter: name=”David Hayward” (or use your own name, unless you’re also called David Hayward). STEP 2 You can check the type of variable in use by issuing the type () command, placing the name of the variable inside the brackets. In our example, this would be: type (name). Add a new string variable:…
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.