Advertisement
luckytyphlosion

wordsearch space solution

Dec 12th, 2015
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. from sys import argv
  2. script, banned_word, phrase = argv
  3. banned_word = banned_word.lower()
  4. old_banned_word = banned_word
  5. phrase = phrase.lower()
  6. split_phrases = phrase.split()
  7. for thing in split_phrases:
  8.     print "Banned word: %s" % banned_word
  9.     if not banned_word.startswith(thing):
  10.         banned_word = old_banned_word
  11.         continue
  12.     else:
  13.         if len(banned_word) == len(thing):
  14.             print "Success"
  15.             break
  16.         else:
  17.             banned_word = banned_word[len(thing):]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement