LoginSignup
21
14

More than 3 years have passed since last update.

【Python】文字列を反転させる方法

Last updated at Posted at 2019-11-21

サンプルコード

# 反転させたい文字列
str = '12345'

# 文字列[::-1]とすれば反転できる
rslt = str[::-1]
print(rslt)
# => '54321'

参考

21
14
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
21
14