In python, an open paranorm causes subsequent lines to be considered part of the same line to close.
So you can do:
def game(word, con): return (word + str('!') + word + str(',') + word + str(phrase1))
But I would not recommend this in this particular case. I mention this because it is syntactically correct and you can use it elsewhere.
Another thing you can do is use a backslash:
def game(word, con): return word + '!' + \ word + ',' + \ word + str(phrase)
Or, in this particular case, my advice would be to use a formatted string.
def game(word, con): return "{word}!{word},{word}{phrase1}".format( word=word, phrase1=phrase1")
It seems like this is functionally equivalent to what you do in your own, but I don't know. The last is what I would do in this case.
If you want to split the string in STRING, you can use "\ n" as a string literal where you need it.
def break_line(): return "line\nbreak"
source share