comment

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

関連記事

no image

C言語でchar文字列の長さを取得する (strlen)

strlen 関数を使って取得すればよい。sizeof という関数もあるが、strlen と振る舞いが異なるので注意。 例 #include<stdio.h> #include<strin …

no image

tex でスクリプト体で数式を入力する方法

大文字のスクリプト体を入力するには、mathrsfs パッケージを使う。 例 \usepackage{mathrsfs} \begin{document} $$\mathscr{ABCDEFGHIJK …

no image

matplotlib で、2種類のデータをプロットする方法

下では、凡例(legend)を設定している。 例 from matplotlib import pyplot as plt data_x = [25,26,27] data_y = [ …

no image

python3 で、pathlib を使ってファイルの拡張子を取得する方法

pathlib モジュールの stem を使う。 この書き方は、python 3.4 以降で使えるようになった。 https://docs.python.org/3/library/pathlib.h …

no image

python3 で、文字列を一文字ずつのリストに変換する方法

string を list() で変換すれば良い。 例 str1 = ‘Good morning.’ list1 = list(str1) print(list1) 結果 [‘G’, ‘o’, ‘o’ …