Solution:
def add_spaces(s):
result = ""
for i in range(len(s)-1):
result += (s[i]+" ")
result += s[-1]
return result
# Testing
print(add_spaces('hello'))
print(add_spaces('hangman'))
print(add_spaces('x'))
And the output will be
hello
hangman
x
Process finished with exit code 0