Created
January 18, 2023 18:07
-
-
Save hamaguchi-amago/a8cf6ea97caedf9a367ae0738eb2e917 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print("数値を入力してください:", end="") | |
x = input() | |
try: | |
x = int(x) | |
print(f"入力(数値):{x}") | |
except ValueError: | |
print(f"入力エラー:{x}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ブログのサンプルとして作成しました。
【Python】input関数を使って入力を受け取る
https://neko-py.com/python-input