Created
June 4, 2016 13:34
-
-
Save anonymous/0dd13a5f449b7467a8c0e881c02364e2 to your computer and use it in GitHub Desktop.
Pythonオレメモ >>154 if...elif...else文
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
# -*- coding: utf-8 -*- | |
x = int(input("整数を入力してください: ")) | |
if x < 0: | |
x = 0 | |
print('負の数はゼロに変換します') | |
elif x == 0: | |
print('ゼロです') | |
elif x == 1: | |
print('イチです') | |
else: | |
print('たくさんです') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment