I just wrote this very simple Python script which finds the sum of two integers. I'm just trying to understand how the return values are assigned to variables:
def add(a,b):
c = a + b
return a
return b
return c
first_number, second_number, result = add(3,4)
print 'first_number is ', first_number
print 'second number is ', second_number
print 'result is ', result
When I try to run this script, I get the following:
Traceback (most recent call last):
File "test.py", line 7, in <module>
first_number, second_number, result = add(3,4)
TypeError: 'int' object is not iterable
Why is that? And, how can I solve this issue?