Skip to content

Instantly share code, notes, and snippets.

@Hemalatah
Last active September 8, 2017 20:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hemalatah/f26988baf1d34fae4f6d1313f2973803 to your computer and use it in GitHub Desktop.
Save Hemalatah/f26988baf1d34fae4f6d1313f2973803 to your computer and use it in GitHub Desktop.
def search_text(text, keyword):
i = 0
while(i < len(text)):
line = ''
while not (text[i] == '.'):
line += text[i]
i += 1
print line
line = line.split(' ')
if keyword in line:
print ' '.join(line)
i += 2
search_text(text, 'iPhone')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment