Skip to content

Commit e5b7cb3

Browse files
authored
Create no_teen_sum.py
1 parent 79493f3 commit e5b7cb3

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Logic-2/no_teen_sum.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
def no_teen_sum(a, b, c):
2+
if fix_teen(a) :
3+
a = 0
4+
if fix_teen(b) :
5+
b = 0
6+
if fix_teen(c) :
7+
c = 0
8+
return a + b + c
9+
10+
def fix_teen(n):
11+
if n == 16 or n == 15 :
12+
return False
13+
elif n >= 13 and n <= 19:
14+
return True
15+
return False

0 commit comments

Comments
 (0)