Last answered:

03 Apr 2022

Posted on:

01 Apr 2022

0

Have a doubt in practice exam

Hi
How will this code return an output of 3 if assigned 5 to the arguement of y. this question is in practice exam 1 (question 3)

def func_x(x):
return x-2

def func_y(y)
return func_x(y)

1 answers ( 0 marked as helpful)
Instructor
Posted on:

03 Apr 2022

0

Hi Smriti!

Thanks for reaching out.

To create functions in Python, the relevant syntax requires from us to use colon and indentation after specifying the function name and argument. Please feel free to revise the following video from the course for further explanation:
https://learn.365datascience.com/courses/introduction-to-python/how-to-create-a-function-with-a-parameter/
With that in mind, please retry taking the question of the given practice exam.

Hope this helps.
Best,
Martin

Submit an answer