Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- empty = []
- # An empty list called empty
- active = [True]
- '''A list called active with single boolean
- value of True'''
- favorite_numbers = [3, 5, 7, 12, 100]
- ''' A list called favorite_numbers
- containing 5 integers'''
- colors = ["red", "green", "blue"]
- ''' A list called colors and containing 5
- colors'''
- def is_long(list):
- if len(list) > 5:
- return True
- else:
- return False
- '''A function that accepts a single list,
- and outputs True if the length of lists
- is greater than 5, otherwise False'''
- print(is_long(["food", "game", "music", "sleep", "book", "movie"]))
- print(is_long([3, 5, 7, 9, 12, 100]))
- print(is_long(["food", "music", "book"]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement