How to input a character string in Python and output it as it is or in the opposite direction.

I am writing how to input, output, and output a string in Python in the opposite direction. I look forward to working with you.

First, how to enter a string in Python.

s = input()

If you want to output as it is.

print(s)

When you want to output the character string in the opposite direction.

print(s[::-1])

that's all. Thank you very much.

Recommended Posts

How to input a character string in Python and output it as it is or in the opposite direction.
[Introduction to Python] How to output a character string in a Print statement
[Python] How to expand variables in a character string
Python learning basics ~ How to output (display) a character string? ~
It is easy to execute SQL with Python and output the result in Excel
Delete a particular character in Python if it is the last
How to judge that the cross key is input in Python3
[Python] How to invert a character string
How to quickly count the frequency of appearance of characters from a character string in Python?
How to use is and == in Python
[Python] How to scrape a local html file and output it as CSV using Beautiful Soup
[Python] The role of the asterisk in front of the variable. Divide the input value and assign it to a variable
[Introduction to Python] How to write a character string with the format function
How to embed a variable in a python string
How to output "Ketsumaimo" as standard output in Python
[Python] How to save the installed package and install it in a new environment at once Mac environment
[Python] How to name table data and output it in csv (to_csv method)
How to count the number of elements in Django and output to a template
Use libsixel to output Sixel in Python and output a Matplotlib graph to the terminal.
Check if the string is a number in python
How to convert / restore a string with [] in python
[Python] How to output the list values in order
How to generate a QR code and barcode in Python and read it normally or in real time with OpenCV
How to check in Python if one of the elements of a list is in another list
[Mac] A super-easy way to execute system commands in Python and output the results
How to use the __call__ method in a Python class
Change the standard output destination to a file in Python
How to get the last (last) value in a list in Python
Find out how many each character is in the string.
In Django, how to abbreviate the long displayed string as ....
[VBA] Function to judge whether the character string of UTF-8 file system is 255 or less and function to count UTF-8 character string in bytes
It is blocked by Proxy, a connection error occurs in Python or pip, and it is retried.
Recursively get the Excel list in a specific folder with python and write it to Excel.
When a character string of a certain series is in the Key of the dictionary, the character string is converted to the Value of the dictionary.
[Python] What is a tuple? Explains how to use without tuples and how to use it with examples.
An easy way to view the time taken in Python and a smarter way to improve it
How to determine the existence of a selenium element in Python
How to install OpenCV on Cloud9 and run it in Python
How to give and what the constraints option in scipy.optimize.minimize is
How easy is it to synthesize a drug on the market?
How to check the memory size of a variable in Python
How to get a string from a command line argument in python
[Introduction to Python] How to use the in operator in a for statement?
How to check the memory size of a dictionary in Python
How to extract the desired character string from a line 4 commands
Get the formula in an excel file as a string in Python
[Golang] Check if a specific character string is included in the character string
[Introduction to Python] How to use the Boolean operator (and ・ or ・ not)
How to display bytes in the same way in Java and Python
Run the output code on the local web server as "A, pretending to be B" in python
Write a script in Shell and Python to notify you in Slack when the process is finished
Summary of character string format in Python3 Whether to live with the old model or the new model
[Python] What is pip? Explain the command list and how to use it with actual examples
In the python metaclass, pass the comparison operator as a string to the ORM method to assemble the where clause.
How to get a stacktrace in python
[Python] What is a formal argument? How to set the initial value
[Introduction to Python] What is the difference between a list and a tuple?
How to write the correct shebang in Perl, Python and Ruby scripts
[Python] Sweet Is it sweet? About suites and expressions in the official documentation
How to get the date and time difference in seconds with python
Migration from Python2 to Python3 (Python2 is rebuilt as a virtual environment and coexists)