Hardware Reference
In-Depth Information
Press Return. You should see Python run your first line of code and display the greet-
ing shown in Figure B-2.
Figure B-2:
Python says
“Hello World”.
Many programmers write a “Hello World” program whenever they learn a new language. It is
about the simplest program and is a good way to check that it is possible to write some code
and then run it. It dates back to the first tutorials of how to program in the 1970s. There's even
an equivalent in hardware to “Hello World” in Chapter 1, “Test Your Reactions .
NOTE
If you got the result shown in Figure B-2, then welcome to the club - you're now a computer
programmer! If not, go back and make sure that you typed the code exactly as shown in the
example (sometimes even the number of spaces matter in Python), because computers need
to be told precisely what to do. This strict rule means that unlike English, a statement can
only be interpreted with one meaning.
Saving Your Program
IDLE allows you to save your code so that you don't have to re-enter it each time you want to
run it. Just follow these steps:
 
Search WWH ::




Custom Search