Python - For Loop
Which of the following is the correct syntax to loop over each character in the string
text?text?for variable in string:.for char in text:
print(char) uses correct syntax. The other options use invalid syntax like 'to' instead of 'in', range() on a string, or non-existent .length attribute.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions