How to flip an input backwards with phyton | Sololearn: Learn to code for FREE!

0

How to flip an input backwards with phyton

Sample input:howdy Sample output:ydwoh

5/18/2021 8:33:16 PM

$$BANANA$$

5 Answers

New Answer

+4

You can loop over the length of it and start with character printing from last index to first index . or you can use slicing to reverse it , i.e. string[::-1].

+2

You can simply use slicing for it: "howdy"[::-1] ---> "ydwoh"

+2

More about slices: https://www.sololearn.com/learning/2453/

+2

If you have access to google.com, try searching for this: "How to flip an input backwards with python". https://stackoverflow.com/questions/931092/reverse-a-string-in-python?noredirect=1&lq=1 https://stackoverflow.com/questions/29092778/how-to-reverse-user-input-in-python

0

Thanks Abhay...can u tell me where u learn from cos I didnt see this in my module...Buh anyway I haven't gone far😅