[Python] How do I reverse a string in Python without using reverse() [duplicate]

Discussão em 'Python' iniciado por Stack, Junho 24, 2025.

  1. Stack

    Stack Membro Participativo

    How do I reverse a string on Python

    I tried using.reverse () because I thought it would reverse the string like it does with lists. I expected the output to be 'olleh', but instead I got an error : AttributeError: 'str' object has no attribute 'reverse'.

    Continue reading...

Compartilhe esta Página