代码示例:(标识:python_iterator_loop_2)
python_iterator_loop_2.py
mystr = "banana"

for x in mystr:
  print(x)
运行结果: