loop
through a string :# Looping through a string
text = "hello"
for char in text:
print(char)
h
e
l
l
o
for
` loop to iterate over each character in the string `text
`. Inside the loop, we use the `print()
` function to print each character on a new line.for
` loop to iterate over each character in a string or any other sequence of items such as a list or tuple. The loop will execute once for each item in the sequence, and the loop variable (in this case, `char
`) will take on the value of each item in turn.