Advertisement
Jamesbusayo

Untitled

Feb 22nd, 2020
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. def long_word_in_collection(word_list, string):
  2.     if string in word_list and len(string) > 4:
  3.         return True
  4.     else:
  5.         return False
  6.  
  7. words = ["cat", "dog", "rhino"]
  8. print(long_word_in_collection(words, "rhino"))
  9. print(long_word_in_collection(words, "cat"))
  10. print(long_word_in_collection(words, "monkey"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement