Sep-24-2020, 01:07 PM
(Sep-23-2020, 11:18 PM)prasanthbab1234 Wrote: instead of adding the numbers directly in my_sum, set my_sum to be the result of your adds_numbers function.[/quote]
Hi Buran,
I tried with same code which you mentioned but one of the validation fail while executing this.
def adds_numbers(x, y): my_sum = x + y return my_sum my_sum = adds_numbers(10, 31) print(my_sum)Validation1 passed :- Check if the variable my_sum has correct value
Test Output
41
Validation2 failed:- Checking if the my_sum variable is not hard-coded.
Description
Searched your code for a specific pattern:
my_sum\s*=\s*(10|31)\s*\+\s*(10|31)
and if I adjust the indent inside I'm getting syntax error NameError: name 'my_sum' is not defined