comment

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

関連記事

no image

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

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

no image

matplotlib で、縦横の線(グリッド)を描く方法

pyplot grid で縦横線(罫線のようなもの)を引くことができる。 例 from matplotlib import pyplot as plt data_x = [25,26,27] …

no image

python3 で辞書からタプルを作成する

辞書に対して、items() メソッドを使うと、タプルを作成することができる。 例 cities = {‘東京’:1000,’大阪’:700, ‘広島’:100} for a,b in cities. …

no image

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

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

no image

std::vector で、vector の始まりに要素を挿入する

vector に要素を追加するために、emplace を使うことができる。 emplace_back は、vector の末尾に要素を追加する。 例 #include <iostream> #i …