和一般我們在數數字時從1 開始數不同,字串的索引值(index)是從0 開始的,str[4] 代表要取出str 字串裡面的第5 個字元“o”。 Learn 8 : str = "Python".
確定! 回上一頁