Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Function that checks for the existence of a word with more that 4 chracters in a list
- def long_word_in_collection(word_list, word):
- if word in word_list and len(word) > 4:
- return True
- else:
- return False
- #Testing the function
- word_collection = ["open", "source", "festival", "Africa"]
- print(long_word_in_collection(word_collection, "open"))
- print(long_word_in_collection(word_collection, "Festival"))
Add Comment
Please, Sign In to add comment