Home / Python Loops / How to Loop Through a String in Python In this example we will show how to loop through a string in Python. Source Code str = 'abcd' for x in str: print(x) Output: a b c d