Hello, it's nothing but
a = input("")
print (a[::-1])
For example, "how are you" is "uoyera woh". I'd like to make each spelling upside down, not backwards, but backwards based on spacing. If it's "how are you", I want to change it to "you are how" I'm asking you this question because I can't do it I beg you. And I really want to use the input function.
input indexing split python
Please note that there is also a method as below.
s = 'how are you'
' ' '.join(reversed(s.split()))
'you are how'
a = 'how are you'
b = a.split(" ")
ab = ''
b
#['how', 'are', 'you']
for i in range(len(b), 0, -1):
ab += b[i-1] + "
print(ab)
#you are how
If you can't do it after trying it, please refer to it.
a = input().split(' ')
print(a[::-1])
All you have to do is attach the .split('')
© 2024 OneMinuteCode. All rights reserved.