[Type B] Working with Functions – Chapter 3 Sumita Arora

|
Table of Contents

5. What will the following function print when called?

Python
def addEm(x, y, z):
    return x + y + z
    print(x + y + z)

Solution: The function will print nothing when called because the print statement is placed after the return statement, which makes it unreachable.

In short, the function will print nothing when called.

Leave a Reply

Your email address will not be published. Required fields are marked *