+ 4
Please how do i reverse this word"howdy" to "ydwoh" using python
6 Respostas
+ 3
Especially for python there is a very quick and simple way, but for you as beginner it's quite sure better to do this task with a loop. If you share your code here via link to playground, we'll help you to solve it.
+ 2
Lotus Robe You can also visit
https://www.geeksforgeeks.org/reverse-words-given-string-JUMP_LINK__&&__python__&&__JUMP_LINK/amp/
for more
+ 2
There are many ways for string reversing in python.
Method 1:
s = 'howdy'
print(s[::-1])
Method 2:
s = 'howdy'
rev = ''
for i in range(len(s)-1,-1,-1):
rev += s[i]
print(rev)
#method 2 is used in most programming languages.
Method 3:
s = 'howdy'
l = list(s)
l.reverse()
print(''.join(l))
+ 1
try doing it manually with a for loop to understand how it works.
but if you just want a quick method to do it here is the solution.
text = "howdy"
print(text[::-1])