Chapter 2. Types and Variables
A good name is rather to be chosen than great riches.
Proverbs 22:1
Computer programs consist of commands (often shorthanded as code) and data. This chapter introduces the basics of how computers handle data, and how Python is a bit different from many programming languages.
A Caveman Computer
Figure 2-1 is a drastically simplified diagram of a typical computer’s components.
-
The central processing unit (CPU, or “chip”) is the brains of the operation. Most computers now have multiple CPUs, and we’ll say more about this in Chapters 23 and 29.
-
The random access memory (RAM) is the fast but limited storage area.
-
A disk stores much more data than the RAM does, but is thousands of times slower.
-
Common local input devices include keyboards, touchscreens, mice, ...
Get Introducing Python, 3rd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.