获取元素的值 直接获取 通过循环的方式 下标超出范围,索引越界问题 直接获取:print(变量名[下标的值]) 注意:下标是从0开始的 举例: 代码如下所示: str="I am a student" print(str[0]) print(str[1]