def print_word_by_sep(word, sep): ... for x in word: ... print(x, end=sep)