Skip to Content
入門 Python 3 第3版
book

入門 Python 3 第3版

by Bill Lubanovic, 鈴木 駿, 長尾 高弘
June 2026
Intermediate
804 pages
8h 21m
Japanese
O'Reilly Japan, Inc.
Content preview from 入門 Python 3 第3版

2章データ型と変数

令名は大いなる富にまさり、恩恵は銀や金よりも良い。

—— 箴言22章1節日本聖書協会「口語訳聖書」より引用

コンピュータプログラムはコードとデータから構成される。本章では、コンピュータがデータをどのように処理するかという基本と、Pythonがデータの扱いにおいて他のプログラミング言語とどのように異なるかを説明する。

2.1 コンピュータ

一般的に、コンピュータに含まれているものは何か。

中央処理装置(CPU)
コンピュータの頭脳。現代のコンピュータはCPUが複数のコアを持つ。詳しくは「21章 並行処理」と「27章 パフォーマンス」にて説明する。
ランダムアクセスメモリ(RAM)
データやプログラムを格納する、高速だが容量に限りのある記憶領域。
キャッシュメモリ
RAMと似ているが、RAMよりも小さく高速。
ディスク
RAMよりもずっと多くのデータを格納できるが、数千倍も遅い。
ローカル入力デバイス
キーボード、タッチスクリーン、マウス、カメラ、マイク。
ローカル出力デバイス
ディスプレイとプリンタ。
ネットワーク
ほかのコンピュータとの通信手段。有線と無線がある。

CPU、RAM、キャッシュは揮発性であり、電源が入っている場合のみ機能する。ディスクは不揮発性で、コンピュータ全体の電源が落ちていてもデータを保持する。適切な性能を保つために、高速だが容量の小さいRAMおよびキャッシュと、遅いが大容量のディスクを使い分ける仕組みが常に働いている。

コンピュータプログラムやデータはディスクに格納され、CPUがアクセスする必要が生じるとRAMへ転送される。CPUはRAMからフェッチ(読み出し)して、ディスクに格納する(書き込む)。

本書ではRAMを本棚の並びにたとえて説明する。各棚は高さと幅が同じで、各スロットには固有の番号が付与されている。各場所は個別にアドレス指定できるため、棚にデータを置けば後から発見できる。なお、各スロットの幅は ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

入門 Python 3 第2版

入門 Python 3 第2版

Bill Lubanovic, 鈴木 駿, 長尾 高弘

Publisher Resources

ISBN: 9784814401642Publisher Website