In your code, you are always returning s, the string the user entered. And that return will cause the function so say: 'Hey, I'm done. You can go on now.' All the statements after the return statements won't get called and your program will jump out of the loop directly.
Therefore, remove all of the returns im your loop, as you don't want to end the function while the user is still entering their strings. And you should consider using raw_input() because the normal input() will obly allow entering integers, like this:
while ...:
s = raw_input("...")
a += s
You should notice, that the statement a += s is the same as a = a + s.
Next, the input message in your loop will probably distract the user a lot, when he is entering his strings. You could print a message to him and request input without a message in the loop then. However, thats not neccessary for your code to work, obviously. Here an example:
print "Hey, you can enter strings as long as you dont hit enter directly."
while ...:
s = raw_input()
# go on
Finally, one thing to optimize would be your condition to end the loop. As it is now, it will always add the string once more.
To solve this you can add a condition in your while-loop to check if the user entered an empty string:
if s == '':
break
Then you can change the loop to:
while True:
# ...
And now you just need to return the whole string after the while loop.
while True:
# ...
return a
All these changes in one piece of code will look like this:
def addWords():
print "Hey, you can enter strings as long as you dont hit enter directly."
a = ''
while True:
s = raw_input()
if s == '':
break
a += s
return a
I am answering this on my mobile, so please excuse any mistakes.
I hope I could help you.
1Darco1