Wiley Beginning Python 978-0-7645-9654-4 ユーザーズマニュアル

製品コード
978-0-7645-9654-4
ページ / 12
1
Programming Basics
and Strings
This chapter is a gentle introduction to the practice of programming in Python. Python is a very
rich language with many features, so it is important to learn to walk before you learn to run.
Chapters 1 through 3 provide a basic introduction to common programming ideas, explained in
easily digestible paragraphs with simple examples.
If you are already an experienced programmer interested in Python, you may want to read this
chapter quickly and take note of the examples, but until Chapter 3 you will be reading material
with which you’ve probably already gained some familiarity in another language.
If you are a novice programmer, by the end of this chapter you will have learned some guiding
principles for programming, as well as directions for your first interactions with a programming
language — Python. The exercises at the end of the chapter provide hands-on experience with the
basic information that you’ll have learned.
How Programming Is Different
from Using a Computer
The first thing you need to understand about computers when you’re programming is that you
control the computer. Sometimes the computer doesn’t do what you expect, but even when it
doesn’t do what you want the first time, it should do the same thing the second and third time —
until you take charge and change the program.  
The trend in personal computers has been away from reliability and toward software being built
on top of other, unreliable, software. The results that you live with might have you believing that
computers are malicious and arbitrary beasts, existing to taunt you with unbearable amounts of
extra work and various harassments while you’re already trying to accomplish something. If you
do feel this way, you already know that you’re not alone. However, after you’ve learned how to
program, you gain an understanding of how this situation has come to pass, and perhaps you’ll
find that you can do better than some of the programmers whose software you’ve used.
04_596543 ch01.qxd  6/29/05  10:59 PM  Page 1
COPYRIGHTED MATERIAL