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

Numbers and Expressions

We’ve seen some basic mathematical expressions with Python, simple addition and the like. Let’s expand on that now and see just how powerful Python is as a calculator. You can work within the IDLE Shell or in the Editor, whichever you like.
Numbers and Expressions
IT’S ALL MATHS, MAN You can get some really impressive results with the mathematical powers of Python; as with most, if not all, programming languages, maths is the driving force behind the code. STEP 1 Open up the GUI version of Python 3, as mentioned you can use either the Shell or the Editor. For the time being, you’re going to use the Shell just to warm our maths muscle, which we believe is a small gland located at the back of the brain (or not). STEP 2 In the Shell enter the following: You can see that Python can handle some quite large numbers. STEP 3 You can use all the usual mathematical operations: divide, multiply, brackets and so on. Practise with a few, for example: STEP 4 You’ve…
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.