Appendix. Answers to Self-Test Questions
Here are the answers to the “Test your knowledge” and “Try it out” questions at the end of each chapter. Of course, there’s sometimes more than one right answer, especially with the “Try it out” questions, but you can use these answers to see if you are on the right track.
In Windows, start IDLE by opening the Start menu, and under the Python 2.5 entry, select the IDLE (Python GUI) entry. In Mac OS X, click IDLE in the Dock, or double-click IDLE.app in the Applications folder. In Linux, it depends on which window manager you are using, but usually there is some sort of Applications or Programs menu.
print displays some text in the output window (the IDLE shell window, in our first examples).
The symbol for multiplication in Python is * (the asterisk symbol).
When you run a program, IDLE displays this line:
“Executing” a program is another way to say “running” a program.
>>> print 7 * 24 * 60 (7 days in a week, 24 hours in a day, 60 minutes in an hour).
You should get 10,080 as the answer.
Your program should look something like this:
You tell Python that a variable is a string by putting quotes around it.