Why do I need to return num 3?

def first_three_multiples(num):
print(num)
print(num2)
print(num
3)
return num*3

Uncomment these function calls to test your first_three_multiples function:

first_three_multiples(10)

should print 10, 20, 30, and return 30

first_three_multiples(0)

should print 0, 0, 0, and return 0

On the above code, I am not sure why the 5th line line, " return num*3 " is necessary, when you run the function, it returns, 10,20,30.

1 Like

hello could someone explain if “return num3" is necessary? I remove them from the syntax, it works still, is there any reason why this "return num3” exist in solution?

thank you

1 Like

The instructions for the function specify that it should “return the third multiple.”

If your code has passed one time, the “Next” box will remain highlighted and receptive to a click no matter what you subsequently type. But if you first click the “Reset Exercise” icon (located next to “Run”) and then type in the code without the return statement, it will not pass.

1 Like