Skip to content

Instantly share code, notes, and snippets.

@chuck0523
Created May 28, 2016 00:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chuck0523/461498121a069c59cf4e82eb64e19f99 to your computer and use it in GitHub Desktop.
Save chuck0523/461498121a069c59cf4e82eb64e19f99 to your computer and use it in GitHub Desktop.
# 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