Last active
April 16, 2020 23:00
-
-
Save ashitaka1963/4c3f019ebf8edfa18ca15e0833527533 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
# 文字列 | |
s='abc' | |
print(s[::-1]) # cba | |
# リスト | |
s=['a','b','c'] | |
print(s[::-1]) # ['c', 'b', 'a'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment