Computer Science

What will the following function return?

def addEm(x, y, z): 
   print(x + y + z) 
x = y = z = 10

Python Functions

2 Likes

Answer

The function addEm will return None. The provided function addEm takes three parameters: x, y, and z. It calculates their sum, which is 30, and then prints it. However, it doesn't explicitly return any value. In Python, when a function doesn't have a return statement, it implicitly returns None.

Answered By

3 Likes


Related Questions