forked from nehirozdemir/wise2324
-
Notifications
You must be signed in to change notification settings - Fork 0
/
code_review.txt
31 lines (24 loc) · 1.04 KB
/
code_review.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Hello Nehir,
Take a look at the error message on Tutron. At the end it says:
Expected:201773941
Received: None
If a function does not have a return statement, a
return None added. That’s where the “None” comes from. The functions
print_sum and print_prod have a return statement, but your
Function wrapped_f has no return statement. print_sum and
print_prod is called f within wrapped_f. Also hat
f a return value, which you now want to use as the return value of wrapped_f
must “forward”, for example like this:
if negative_indicator > 0:
print("No negative numbers allowed")
return_value = None
different:
return_value = f(sequence)
return return_value
Does this help you? :) Decorators are confusing at first because man
Pretty much has to jump around in the code to find the path of execution
to understand.
There is another small error in your code. The function should
can be aborted if there is a negative number among the numbers passed
is there. Not just after potentiation.
Best regards