0
Python problem
Hi, what should the correction be? In this problem : Q. Fix the code below: def compute_num(): a=4 b=5 c=a+b return c j=2 s=1 print(compute_num(j,s)) If I add the argument in the function body I don't get the result should be which is 3 j+s
2 Respuestas
+ 5
Hey Maryam Magdy, you forget to add the function parameters in the function definition
The "a" and "b" isn't needed since you are adding
j and s:
def compute_num(j, s):
c=j+s
return c
j=2
s=1
print(compute_num(j, s))
0
ᐱᐯᗠ thank you 😊