C言語で scanf のようなものを作るには、python では input() で実現できる。
例
print('xの値を入力してください')
x = input()
print('xの値は ' + x)
結果
xの値を入力してください 234 xの値は 234
雑記
投稿日:2020年11月28日 更新日:
C言語で scanf のようなものを作るには、python では input() で実現できる。
print('xの値を入力してください')
x = input()
print('xの値は ' + x)
xの値を入力してください 234 xの値は 234
執筆者:seyanen
関連記事
matplotlib で、x,y の軸上の数値を表示する方法
ax の xtics と ytics を使って表示する。 詳細は次のドキュメントを参照。 https://matplotlib.org/stable/gallery/lines_bars_and_ma …
os.mkdir() 関数を使う。 すでにフォルダが存在している場合は、エラーを表示する。 例 import os folder_name = ‘./python_create_folder’ try …
凡例(legend)の表示位置を変更するには、axis の legend の loc を設定する。 次のリンクhttps://matplotlib.org/stable/api/_as_gen/mat …
matplotlib で、粗い刻みと細かい刻みの目盛りを表示する方法
set_major_locator で粗い刻みの目盛りを調整する。 set_minor_locator で、細かい刻みの目盛りを調整する。 以下の例で set_major_formatter は、表示 …
2023/01/18
matplotlib のグラフ作成と gnuplot との対応 比較
2022/10/14
pythonで配列(リスト)の、ある要素がわかっているときにその次の要素を取得する方法。