Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Can anyone tell me which function is not working and its reason? Exercise 4: Given 3 int values, a b c, return their sum. However,
Can anyone tell me which function is not working and its reason?
Exercise 4: Given 3 int values, a b c, return their sum. However, if any of the values is a teen -- in the range 13.. 19 inclusive -- then that value counts as 0, except 15 and 16 do not count as a teens. Write a separate helper "def fix_teen(n):" that takes in an int value and returns that value fixed for the teen rule. In this way, you avoid repeating the teen code 3 times (i.e. "decomposition"). a A) def no_teen_sum (a, b, c): a = fix_teen (a) b = fix_teen (b) C = fix_teen (c) return a + b + c C) def no_teen_sum (a, b, c): = fix_teen (a) b = fix_teen (b) C = fix_teen (c) return a + b + c def fix teen (n): if n == 15 or n == 16: return n else: return 0 def fix teen (n): if n == 15 or n == 16: return n if n >= 13 and n =13 and =13 and b =13 and c = 13 and nStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started