comment

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

関連記事

no image

python3 で文字列のリストを結合する方法

list に対して、extend を使う。 例 list1 = [1,2,3] list2 = [4,5,6] list1.extend(list2) print(list1) 結果 [1, 2, 3 …

no image

matplotlib で複数のグラフを並べて表示する方法

plot.subplots() でグラフの縦方向と横方向の数を指定する。 例 import numpy as np from matplotlib import pyplot as plt x1 = …

no image

tex の equation 環境で複数行の数式を入力する(\split を使う)

\equation の中で \split を使う。 \tag を使って、自分で定義した式番号を使える。 例 \begin{equation} \begin{split} a \\ b \\ c \en …

no image

python3 で、文字列が別の文字列に含まれているかどうか判定する方法

in 演算子を使うことが最も簡単。 例 str1 = “こんにちは” str2 = “んにち” if str2 in str1:  print(“含まれています”) else:  print(“含まれ …

no image

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

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