Created
October 25, 2017 13:11
-
-
Save hoanbka/b37eb54bbef3af3835ff7ea56fbba07b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
def isTangle(a, b, c): | |
if a <= 0 or b <= 0 or c <= 0: | |
return False | |
else: | |
if a + b >= c and a + c >= b and a <= b + c: | |
return True | |
def showInfo(): | |
count = 5 | |
while (count > 0): | |
print('please input: ') | |
a = input('a = ') | |
b = input('b = ') | |
c = input('c = ') | |
count -= 1 | |
try: | |
a = int(a) | |
b = int(b) | |
c = int(c) | |
if isTangle(a, b, c): | |
break | |
except ValueError: | |
print('Invalid input') | |
print('Congrats') | |
showInfo() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment