📜  python 遍历字符串 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:53.653000             🧑  作者: Mango

代码示例2
"""
Python Program:
 Using slice [] operator to iterate over a string partially
"""
string_to_iterate = "Python Data Science"
for char in string_to_iterate[0 : 6 : 1]:
   print(char)