8890
8890.tw
  • 首頁
  • 測試工程
  • 特斯拉
  • Python
  • 游泳技巧
  • 生活點滴
  • 八字
Python

Python 字串reversed

by YFYeh 2021-12-09
written by YFYeh 2021-12-09 0 留言

在處理pattern時候,很常會遇到字串需要反轉,把MSB與LSB對調,剛好遇到,就筆記一下。

str_a = 'ABCDEFG'
print(str_a)
print(''.join(reversed(str_a)))

哈哈,神同事看一下,說這樣不行,應該要這樣寫,太狂了。

str_a = 'ABCDEFG'
str_a = str_a[::-1]
print(str_a)
python字串
分享起來 0 FacebookLINEEmail
YFYeh

一位平凡上班族,如果不利用下班後的時間學習,那人生似乎有點平淡。 於是利用下班後時間自主學習、充實自我,熱愛吸收新知識,於是想把自己的學習紀錄分享在部落格中,一方面可以記錄,另一方面也可以與大家討論,激盪出更多可能。

上一篇文章
電動車新生活
下一篇文章
天浩佛堂2.0

你可能也喜歡

Python L...

2023-03-27

Python內建...

2022-10-11

Python 自...

2022-09-30

留個言吧 Cancel Reply

Save my name, email, and website in this browser for the next time I comment.

搜尋更多

文章分類

  • Python
  • 八字
  • 測試工程
  • 游泳技巧
  • 特斯拉
  • 生活點滴

Related Posts

  • Python Lambda vs Function

    2023-03-27
  • Python內建函式查詢

    2022-10-11
  • Python 自動產生 Flowchart !

    2022-09-30

Copyright @2022 - 8890.tw


Back To Top
8890
  • 首頁
  • 測試工程
  • 特斯拉
  • Python
  • 游泳技巧
  • 生活點滴
  • 八字