M
M
maximka122016-02-02 06:59:55
Python
maximka12, 2016-02-02 06:59:55

Python, how to output text backwards?

I started learning python, and at the end of the chapter on lists and indexes, I came across a problem: It is
necessary to write a program that accepts user text and displays this text on the screen in reverse.
How to do it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Riedel87, 2016-02-02
@maximka12

Hey! But this will work for you:
s = 'Python is the best programming language'
>>> s[: :-1]
Outputs - 'egaugnal gnimmargorp tseb eht si nohtyP'

R
rasswet, 2016-02-02
@rasswet

list.reverse() Reverses a list

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question