' print x[-2] print x[4:-3]. 則會印出" d " 及" o, Wor "。 計算字串長度. 如果要計算字串的長度,直接使用 len() 函式就可以了。 x = 'Hello, World.' print len(x).
確定! 回上一頁