Created
May 28, 2016 00:53
-
-
Save chuck0523/461498121a069c59cf4e82eb64e19f99 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: UTF-8 | |
# スライスを用いて文字列の反転 | |
keys = 'qwertyuiop' | |
print(keys) # qwertyuiop | |
print(keys[::-1]) # poiuytrewq | |
# スライスのステップにマイナス1を指定することで、末尾から1ずつ取得できる。 = 反転。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment