0
How to print on the same line?
input: hello world Sample output: svool dliow https://code.sololearn.com/cMptCB5UTSpH/?ref=app
6 Answers
+ 4
Your albhabet don't have space, so will be ignored so add else part to print as it is.
Next is your logic correct?
Do you need to print reverse?
No I think,
A logic:
If z to print in place of a, then
alphabet['z' - ch] will give you 'a'...
In python, I think it need some syntax changes, not exact one...
+ 5
To keep spaces as they are entered during input, you can split() your input to a list. For split() use a space as separator. Then you can iterate through your list of words and encode them. If this is done, you can join() the elements of the list to a string, that can be printed without any trouble.
+ 3
print(new_word, end= "")
Default end = "\n" so overwrite it like end = "" ie none
+ 1
Thank you Lothar for helping me
0
Jayakrishnađźđł thank you this is nice but there is no spase between them
like(svool dliow)
0
Thank you again this was helpful