You can tell print not to insert a newline:
print(s[x], end="")But my preference would be to
join()
the bits together before printing.>>> s = "abcdefg" >>> print("".join(char for index, char in enumerate(s) if index % 2 != 0)) bdf >>> print(s[1::2]) #Or to do it directly bdf