Python - String String iteration

Introduction

you can iterate over strings in loops using for statements.

Demo

myjob = "test program code" 
for c in myjob: print(c, end=' ')  # Step through items, print each (3.X form) 
print( "k" in myjob )              # Found 
print( "z" in myjob )              # Not found 
print( 'test' in 'abctestdef' )    # Substring search, no position returned
# from   ww  w .ja  v  a2s .  c om

Result