iterating in a string python code example
Example 1: python iterate over string
word = "test"
for letter in word:
print(letter)
Example 2: iterating string in python
"""
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)