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
関連記事
readline を使って次のように書く。 例 ファイル:data.txt # id name age 1 佐藤太郎 10 2 鈴木花子 18 3 坂本明美 21 4 松村光子 24 5 小川奏子 1 …
annotate を使う。 例 import numpy as np from matplotlib import pyplot as plt x = np.linspace(-10,10,100) …
matplotlib でグラフ表示ウィンドウの画面上の位置を自由に設定する方法
matplotlib.use(‘TkAgg’) としておき、 get_current_fig_manager().window.wm_geometry(“+20+50”) として、(+20+50)のと …
文字に tex の記法を使って数式を入力することもできる。 例 import numpy as np from matplotlib import pyplot as plt x = np.linsp …
2023/01/18
matplotlib のグラフ作成と gnuplot との対応 比較
2022/10/14
pythonで配列(リスト)の、ある要素がわかっているときにその次の要素を取得する方法。