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

User Input

We’ve seen some basic user interaction with the code from a few of the examples earlier, so now would be a good time to focus solely on how you would get information from the user then store and present it.
User Input
USER FRIENDLY The type of input you want from the user will depend greatly on the type of program you’re coding. For example, a game may ask for a character’s name, whereas a database can ask for personal details. STEP 1 If it’s not already, open the Python 3 IDLE Shell, and start a New File in the Editor. Let’s begin with something really simple, enter: STEP 2 Save and execute the code, and as you already no doubt suspected, in the IDLE Shell the program will ask for your first name, storing it as the variable firstname, followed by your surname; also stored in its own variable (surname). STEP 3 Now that we have the user’s name stored in a couple of variables we can call them up whenever…
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.