phython: 文字列の結合

pythonによる文字列定義】

pythonにおいては,文字列の定義は

  • シングルクォーテーション
  • ダブルクォーテーション

どちらでも構わない(等価である)。

プログラム例:

y = 'test'

y = "test"

【文字列の結合】

Matlabとは異なり,「+」記号で容易に結合できる。

プログラム例:

y = 'test'

x = 'test2'

z = y + x