Pythonの強力さの源泉は、日付操作のdatetimeや乱数のrandomといった、豊富なライブラリ(モジュール)にあります。これらの機能を使うためには、import文を使って、自分のスクリプトにその機能を読み込む必要があります。 importの方法にはいくつかのパターン ...
本記事はPythonプログラミング学習の第3弾として、コードの基盤となる「四則演算」「データ型」「変数」「コメント」「関数」「モジュールとImport文」について解説する。プログラミングを新しい言語学習に例え、基本文法と単語の習得が複雑な文章 ...
一度定義した関数は、いろいろなところで再利用したいものです。 本連載では、今までPythonのプログラムを記述したファイル「Pythonスクリプト」を作成してきました(Pythonスクリプトについて詳しくは連載第3回をご覧ください)。関数定義をPython ...
Every Python developer knows some or all of these libraries, because they’re stable, reliable, and excellent at what they do.
Pythonに限らず、多くのプログラミング言語には「関数(Function)」という概念があります。関数は特定の機能を「呼び出す」ために使われます。たとえば今までの回で利用していたprint()も関数のひとつで、()の中に入れた変数や定数を出力するという処理を ...
There's a not-so-hidden danger when using Python that you need to be prepared to deal with. All modern software development languages are modular, which means developers can break larger sections of ...
The power of Python trumps Excel workbooks.