Ask coding questions

← Back to all posts
How to reverse a string value.
mahitaravi (0)

how to reverse a string value in python
Without using define
and using range

Answered by VulcanWM (2758) [earned 5 cycles]
View Answer
Comments
hotnewtop
VulcanWM (2758)
string = “hi there”
new = []
for letter in string:
  new.insert(-1, letter)
reversed = “”.join(new)
print(reversed)
# will output the reversed