Advertisement
OsahonE

Wk4_1

Mar 31st, 2020
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.67 KB | None | 0 0
  1. empty = []
  2. # An empty list called empty
  3.  
  4. active = [True]
  5. '''A list called active with single boolean
  6. value of True'''
  7.  
  8. favorite_numbers = [3, 5, 7, 12, 100]
  9. ''' A list called favorite_numbers
  10. containing 5 integers'''
  11.  
  12. colors = ["red", "green", "blue"]
  13. ''' A list called colors and containing 5
  14. colors'''
  15.  
  16. def is_long(list):
  17.     if len(list) > 5:
  18.         return True
  19.     else:
  20.         return False
  21.         '''A function that accepts a single list,
  22.         and outputs True if the length of lists
  23.         is greater than 5, otherwise False'''
  24.        
  25. print(is_long(["food", "game", "music", "sleep", "book", "movie"]))
  26. print(is_long([3, 5, 7, 9, 12, 100]))
  27. print(is_long(["food", "music", "book"]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement