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