Python 支援下表的方式獲取字符串中的值String[頭:尾]或String[下標],下標從0開始,尾部從-1開始 string = "21yi.com" print(string[0]) # 返回2 print(string[1:4]) ...
確定! 回上一頁