import sys debugging = False if len(sys.argv) > 1: if sys.argv[1] == "True": debugging = True words = """Every Night & every Morn Some to Misery are Born Every Morn and every Night Some are Born to sweet delight""" # Find the first word "Morn" character = chr(77) if debugging: print(character) character_location = words.find(character) if debugging: print(character_location) end_location = words.find(" ", character_location) if debugging: print(end_location) first_m_word = words[character_location : end_location] print(first_m_word)