1"""
2Python Program:
3 Using range() to iterate over a string in Python
4"""
5string_to_iterate = "Data Science"
6for char_index in range(len(string_to_iterate)):
7 print(string_to_iterate[char_index])
1"""
2Python Program:
3 Using slice [] operator to iterate over a string partially
4"""
5string_to_iterate = "Python Data Science"
6for char in string_to_iterate[0 : 6 : 1]:
7 print(char)