Skip to content

Instantly share code, notes, and snippets.

@hamaguchi-amago
Created September 14, 2019 12:27
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/7a8b5de95ac4c229651c0e96c2736049 to your computer and use it in GitHub Desktop.
Save hamaguchi-amago/7a8b5de95ac4c229651c0e96c2736049 to your computer and use it in GitHub Desktop.
条件分岐(if~elif~else文)
# -*- coding: utf-8 -*-
import sys
args = sys.argv
param = args[1]
if param.isdecimal():
val = int(param)
if val <= 5:
print("5以下です")
elif val <= 10:
print("10以下です")
else:
print("10より大きいです")
else:
print("数字ではありません")
print("処理終了")
@hamaguchi-amago
Copy link
Author

ブログの記事で作成しました。
興味のある方はご覧ください。

【Python】条件分岐(if、elif、else)のサンプルプログラム
https://neko-py.com/python-conditional-branch

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