python - Make for statements on same line but not next input -


so have slight problem code working on.

while true:         r = input("line: ")     n = r.split()     if r == " ":         break       else:       word in n:         print(word[::-1]), 

it designed output reverse of each word of input, , repeat process until blank entered. however, tried using print (end=" ") make input on same line this:

line: hello world olleh dlrow line: 

any appreciated.

i want output this:

olleh dlrow line: 

print empty line after for loop, so:

print 

(i.e. print keyword nothing after it.)


Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -