To stay in practice with my Python
Python I've decided to write an explicit song checker. It checks each word in the song against an array of 14 explicit words contained in the text file. I've decided not to include the words that are to be checked against, for I am not sure about the rule of having explicit words in a programs codenot sure about the rule of having explicit words in a program's code. Feedback on efficiency and structure is what I'm going for mostly. Style and other critiques are invited as well.
EDIT These are text files, and there are 14 words in the explicit_words
array.
explicit_song_checker.py
explicit_words = [
#explicit words not shown
]
def isClean(song_path):
with open(song_path) as song:
for line in song:
words = line.split(" ")
for word in words:
for explicit_word in explicit_words:
if word == explicit_word:
return False
return True
def main():
song = raw_input("Enter path to song: \n")
if isClean(song):
print("CLEAN")
else:
print("EXPLICIT")
if __name__ == '__main__':
main()