comment

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

関連記事

no image

php で、画面に文字を表示する方法

ブラウザの画面に文字を表示するには、echo を使う。 例 <? echo “こんにちは”; ?> 結果

no image

matplotlib で、x,y の軸上の数値を表示する方法

ax の xtics と ytics を使って表示する。 詳細は次のドキュメントを参照。 https://matplotlib.org/stable/gallery/lines_bars_and_ma …

no image

c++ で文字列が他の文字列を含むか判定する方法

文字列を含むかどうか判定するには、string の find を使う。見つからなかった場合は、std::string::npos を返す。 例 #include <iostream> #i …

no image

c++ で文字列を「区切り文字」を使って分ける方法

string の find を使って、区切り文字の場所を取得し、その位置で区切る。 例 #include <iostream> #include <string> using namesp …

no image

python の __str__ と __repr__ とは

python でクラスの情報を文字列で表示するとき、__str__ メソッドと __repr__ メソッドが使える。__str__ は、プログラマーとは限らないユーザーに「読める形で情報を表示」するこ …