Created
July 18, 2017 12:42
-
-
Save Nickikku/947543aec823d3e8d81e69a15de1c43d 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
#adds only if values are no teens, exept for 15 & 16. | |
def no_teen_sum(a, b, c): | |
if ((a > 10 and a < 15) or (a > 16 and a < 20)) and ((b > 10 and b < 15) or (b > 16 and b < 20)) and ((c > 10 and c < 15) or (c > 16 and c < 20)): | |
return 0 | |
if (a > 10 and a < 15) or (a > 16 and a < 20): | |
if (b > 10 and b < 15) or (b > 16 and b < 20): | |
return c | |
elif (c > 10 and c < 15) or (c > 16 and c < 20): | |
return b | |
else: | |
return b + c | |
if (b > 10 and b < 15) or (b > 16 and b < 20): | |
if (a > 10 and a < 15) or (a > 16 and a < 20): | |
return c | |
elif (c > 10 and c < 15) or (c > 16 and c < 20): | |
return a | |
else: | |
return a + c | |
if (c > 10 and c < 15) or (c > 16 and c < 20): | |
if (b > 10 and b < 15) or (b > 16 and b < 20): | |
return a | |
elif (a > 10 and a < 15) or (a > 16 and a < 20): | |
return b | |
else: | |
return b + a | |
else: | |
return a + b + c | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment