Raspberry Pi For Kids For Dummies®

Raspberry Pi For Kids For Dummies®

Author:Wentk
Language: eng
Format: epub
ISBN: 9781119049494
Published: 2015-05-26T00:00:00+00:00


raw_input doesn’t care what the user types. It’s like a dumb robot. If you type a load of gibberish, it saves the gibberish in the player_answer variable.

The next line in the code prints out whatever is in player_answer. It doesn’t care if it’s gibberish either.

But hey, you’ve ticked off two whole items on your to-do list! You know how to ask the user a question and how to get an answer.

Working out whether the answer makes sense is a different problem.

This is why it’s so cool to break any big project into lots of teeny problems. You can make progress by working on them one at a time.

Why is there a + in the second line? Because you can join two bits of text together with a +. The print command glues the two bits together because of the + and makes them appear on one line. (You can’t do math on text, and this isn’t really math. It just looks a bit like math. Sort of.)



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.