Nov-20-2021, 12:54 AM
If it's a string, then you can create a reversed string by slicing with a -1 step..
>>> x = "foobar" >>> print(x[::-1]) raboof
printing a string in reverse
|
|
Messages In This Thread |
printing a string in reverse - by Skaperen - Nov-20-2021, 12:35 AM
RE: printing a string in reverse - by bowlofred - Nov-20-2021, 12:54 AM
RE: printing a string in reverse - by ghoul - Nov-20-2021, 05:08 AM
|
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
Printing a raw string with a folder separator at the end, duplicates the separator | krulah | 5 | 1,220 |
Nov-28-2022, 12:41 PM Last Post: snippsat |
|
printing an string instead of a expression | Underscore | 2 | 1,812 |
Oct-11-2021, 03:10 PM Last Post: deanhystad |
|
I am trying to reverse a string using loop | codinglearner | 4 | 2,160 |
Sep-28-2021, 10:46 PM Last Post: Pedroski55 |
|
Printing string at specific position on terminal - not showing | __Mathieu__ | 1 | 2,374 |
Sep-07-2020, 10:32 AM Last Post: Larz60+ |
|
Reverse a String | ragav_in | 3 | 2,186 |
Jul-24-2020, 02:24 AM Last Post: ragav_in |
|
Reverse the string word | sneha | 2 | 2,618 |
Dec-12-2019, 03:37 AM Last Post: sneha |
|
printing a bytes string | Skaperen | 2 | 2,354 |
Jul-21-2019, 03:42 AM Last Post: Skaperen |
|
String slicing in python from reverse | ift38375 | 1 | 2,394 |
Apr-29-2019, 06:58 AM Last Post: perfringo |