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

12th Mar 2021, 5:26 PM
Maryam Magdy
Maryam Magdy - avatar
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))
12th Mar 2021, 5:31 PM
A C K
A C K - avatar
0
ᐱᐯᗠ thank you 😊
12th Mar 2021, 5:37 PM
Maryam Magdy
Maryam Magdy - avatar