#Why is there an error in the code and how would you fix it?

def foo(a, b):
    print(a + b)
    return a+b

#print(type(foo(2,3)))
x = foo(2, 3) * 10

# Line 4 throws a TypeError because Python cannot
# multiply a None type object with an integer.
# The function output is what produces a None object
# because the function definition is not returning anything.
# Fix it by using return  instead of print
3055a3248b5684ac53b75d63b079b8b0789fff07
<mask token>

def foo(a, b):
    print(a + b)
    return a + b


<mask token>

def foo(a, b):
    print(a + b)
    return a + b


x = foo(2, 3) * 10

#Why is there an error in the code and how would you fix it?

def foo(a, b):
    print(a + b)
    return a+b

#print(type(foo(2,3)))
x = foo(2, 3) * 10

# Line 4 throws a TypeError because Python cannot
# multiply a None type object with an integer.
# The function output is what produces a None object
# because the function definition is not returning anything.
# Fix it by using return  instead of print