Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '''A program that returns True if second
- argument passed is in the first argument -
- a list and second argument has a length
- of more than 4 characters, otherwise
- returns False'''
- def long_word_in_collection(list, arg: str):
- if arg in list and len(arg) > 4:
- return True
- else:
- return False
- animals = ["dog", "cat", "rhino", "bat", "antelope"]
- print(long_word_in_collection(animals, "antelope"))
- print(long_word_in_collection(animals, "dog"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement