プログラミング言語「Python」は、シンプルな記法を持つ一方で、その裏側には複雑な実行の仕組みが存在する。プログラムのエントリーポイント(プログラムの実行開始点)を定義する方法から、Pythonの本質的な特徴を考えてみよう。 エントリーポイントを ...
そして、先ほどPythonは科学計算が得意である点に言及しましたので、数値計算ライブラリのNumPyの使い勝手の良さも紹介しましょう。 以下のプログラムは、NumPyで多次元配列を二倍にする例です。 # NumPyを使うことを宣言 import numpy as np # NumPyで多次元配列を定義 ...
Ever heard of Hello World? This sample code is a programmer’s rite of passage, but what does it mean and why do we use it? Discover the program’s history and see how it reveals various language ...