79834105

Date: 2025-11-30 18:22:53
Score: 1.5
Natty:
Report link
You can reverse a string in Python in multiple ways:

1. Using slicing (shortest and fastest)
s = "hello"
print(s[::-1])

2. Using reversed() with join
s = "hello"
print("".join(reversed(s)))

3. Using a loop
s = "hello"
res = ""
for ch in s:
    res = ch + res
print(res)

All of these output: "olleh"
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Ronit Raj Verma