Skip to content

Instantly share code, notes, and snippets.

@hamaguchi-amago
Created January 18, 2023 18:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hamaguchi-amago/a8cf6ea97caedf9a367ae0738eb2e917 to your computer and use it in GitHub Desktop.
Save hamaguchi-amago/a8cf6ea97caedf9a367ae0738eb2e917 to your computer and use it in GitHub Desktop.
print("数値を入力してください:", end="")
x = input()
try:
x = int(x)
print(f"入力(数値):{x}")
except ValueError:
print(f"入力エラー:{x}")
@hamaguchi-amago
Copy link
Author

ブログのサンプルとして作成しました。

【Python】input関数を使って入力を受け取る
https://neko-py.com/python-input

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment