Python 模擬試験

PythonZen & PEP 8 模擬試験 第2回 問6・The Zen of Python(The Zen of Python の格言)

Although that way may not be obvious

「Although that way may not be obvious at first unless you're Dutch.」の「Dutch」が指すと一般に言われる人物として、最も適切なものを1つ選べ。

  1. A

    Linux の作者である Linus Torvalds

  2. B

    Ruby の作者であるまつもとゆきひろ

  3. C

    Python の作者であるオランダ人の Guido van Rossum

  4. D

    Java の作者である James Gosling

正解と解説を見る

正解:C

この「Dutch」は、オランダ出身の Python の作者 Guido van Rossum を指すと言われる。最初から分かりやすい書き方とは限らない、という冗談。

The Zen of Python(PEP 20)の格言と意味。
格言意味
Beautiful is better than ugly.美しい方が、醜いよりよい
Explicit is better than implicit.明示的な方が、暗黙的よりよい
Simple is better than complex.単純な方が、複雑よりよい
Complex is better than complicated.複雑でも、ごちゃごちゃ(complicated)よりはよい
Flat is better than nested.平らな方が、入れ子より(深い入れ子より)よい
Sparse is better than dense.ゆとりのある方が、詰め込みよりよい
Readability counts.読みやすさは大事
Special cases aren't special enough to break the rules.特別な場合でも、規則を破るほど特別ではない
Although practicality beats purity.ただし、実用性は純粋さに勝る
Errors should never pass silently.エラーを黙って見過ごしてはいけない
Unless explicitly silenced.明示的に黙らせた場合は別
In the face of ambiguity, refuse the temptation to guess.あいまいなときは、推測したくなる誘惑を断る
There should be one-- and preferably only one --obvious way to do it.明白なやり方が1つ、できればただ1つだけあるべき
Although that way may not be obvious at first unless you're Dutch.その方法は、オランダ人でなければ最初は分かりにくいかもしれない
Now is better than never.やらないよりは、今やる方がよい
Although never is often better than *right* now.ただし、「今すぐ」よりやらない方がよいことも多い
If the implementation is hard to explain, it's a bad idea.実装を説明しにくいなら、悪い考え
If the implementation is easy to explain, it may be a good idea.実装を説明しやすいなら、よい考えかもしれない
Namespaces are one honking great idea -- let's do more of those!名前空間は素晴らしい考え。もっと活用しよう

学習のポイント:The Zen of Python は PEP 20 として定められ、Tim Peters が書いた。

この問題を演習で解く →

問題一覧へ

このサイトの問題は、各試験の公式に示された出題範囲に沿って作ったオリジナルの模擬問題です。本試験の問題ではありません。一般社団法人Pythonエンジニア育成推進協会の公式サービスではありません。