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  w ww  .ja  v  a2 s.  co  m

Result