Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def long_word_in_collection(word_list, string):
- if string in word_list and len(string) > 4:
- return True
- else:
- return False
- words = ["cat", "dog", "rhino"]
- print(long_word_in_collection(words, "rhino"))
- print(long_word_in_collection(words, "cat"))
- print(long_word_in_collection(words, "monkey"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement