Let's say I want to add these strings together: "I"
"use"
"Python"
Firstly, I could concatenate them using the + sign like this:
print("I " + "use " + "Python")
But that is bulky and wastes a lot of time, especially when you need to combine a lot of strings. Also, note that I embedded the spaces into the string, whereas I usually have to use variables, meaning that I have to add spaces separately, which is an even bigger pain.
Secondly, there is a way to add with commas:
print("I", "use", "Python")
This is what I want, however this has a caveat. It doesn't seem to work in return functions.
def function():
return "I", "use", "Python"
print(function())
This returns a tuple, instead of the string I want, which means that sigh, I have to use the boring plus sign concatenation. This sucks up tons of time because I need to continuously add spaces.
So back to the main question, how do I use this method in a return statement?