Python string inversion

There are times when you want to reverse the order of strings and arrays. In such a case, you can reverse it by doing the following.

Below sample

reverse.py


alpha = "abcdefghijklmnopqrstuvwxyz"
alpha = alpha[::-1]
print alpha

zyxwvutsrqponmlkjihgfedcba

For more information http://d.hatena.ne.jp/redcat_prog/20111104/1320395840

Recommended Posts

Python string inversion
Python string
Python: String concatenation
Python string format
python string slice
Python2 string type
Python string format
Python # string type
String manipulation in python
[Python] Multi-line string assignment
Python string manipulation master
[Python2] Date string-> UnixTime-> Date string
Random string generation (Python)
Python3> documentation string / docstring
Python string processing illustration
[python] Convert date to string
Python indentation and string format
Python
String object methods in Python
[Python] Use a string sequence
About Python string comparison operators
String date manipulation in Python
Python f character (formatted string)
String replacement with Python regular expression
python string processing map and lambda
Create a random string in Python
kafka python
Conversion of string <-> date (date, datetime) in Python
Python basics ⑤
python + lottery 6
Python Summary
Built-in python
Python comprehension
Python technique
Studying python
Python 2.7 Countdown
Python memorandum
Python FlowFishMaster
Python service
python tips
String format
python function ①
Python basics
Python memo
ufo-> python (3)
Python comprehension
install python
Python Singleton
(Java, JavaScript, Python) Comparison of string processing
Python basics ④
Python Memorandum 2
python memo
Python UTC ⇔ JST, character string (UTC) ⇒ JST conversion memo
Python Jinja2
Python increment
atCoder 173 Python
[Python] function
Python installation
python tips
Try python
Python memo