劉任昌w3schools字串切割slicing

b = "貓抓鼠,狗吃屎,兔吃土"
#   0 1 2 3 4 5 6  7  8  9  10
#              -5 -4 -3  -2 -1
print('劉任昌w3schools字串切割slicing')
print('第-5至-2:'+b[-5:-2])
print('第 6至 9:'+b[6:9])
print('整個顛倒:'+b[::-1])

留言

  1. https://cpc920508123.blogspot.com/2023/03/w3schoolsslicing.html

    回覆刪除
  2. https://enchenghu0905.blogspot.com/2023/03/w3schoolsslicing.html

    回覆刪除
  3. https://d11150114.blogspot.com/2023/03/w3schoolsslicing.html

    回覆刪除
  4. https://cindy-javascript.blogspot.com/2023/03/w3schoolsstrformatslicing.html

    回覆刪除
  5. https://d11150108.blogspot.com/2023/03/w3schoolsslicing.html

    回覆刪除
  6. https://d11150112.blogspot.com/2023/03/w3schoolsslicing.html

    回覆刪除
  7. https://iuytjhg5261.blogspot.com/2023/03/w3schoolsstrformatslicing.html

    回覆刪除
  8. https://643gjeytfru4312.blogspot.com/2023/03/w3schoolsslicing_5.html

    回覆刪除
  9. https://d11150116.blogspot.com/2023/03/w3schoolsslicing_5.html

    回覆刪除
  10. https://changmasaxciksdj.blogspot.com/2023/03/svgcanvas.html

    回覆刪除
  11. https://www.blogger.com/blog/post/edit/7946957304410713297/8581370351702887348

    回覆刪除

張貼留言

這個網誌中的熱門文章

劉任昌對照Python與JavaScript指令

劉任昌Python集合set清單list元組tuple字典dictionary

劉任昌python, input, str, float