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 …
pyplot.errorbar を使って設定する。 オプションの詳細は https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.erro …
items() で辞書から要素を取り出し、random.choice でランダムに要素を選択する。 例 import random # 県庁所在地 mydict = {‘宮城県’:’仙台市’,’茨城県 …
2023/01/18
matplotlib のグラフ作成と gnuplot との対応 比較
2022/10/14
pythonで配列(リスト)の、ある要素がわかっているときにその次の要素を取得する方法。