I write this code but it does not work:
a=input('word: ')
for i in a:
print(i,'')
what is the problem?
You should provide the expected output because now we have to assume what it is you are trying to achieve.
When using "abc" as input I am now assuming you want
a b c
instead of
a
b
c
The problem here is, with every loop you call the 'print' function which starts a new line automatically when you should format your output correctly before calling print. Try this:
a=input('word: ')
s = ""
for i in a:
s += i + " "
print(s)