Guest User

Untitled

a guest
Jul 22nd, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. robs_favs = ['pizza', 'bacon cheeseburgers', 'cupcakes']
  2. foods_in_common = []
  3.  
  4. f = open('myfoods.csv')
  5.  
  6. for food in f.readlines():
  7. food = food.strip("\n").strip("\r") # stripping invisible returns and new lines
  8. if food in robs_favs:
  9. foods_in_common.append(food)
  10.  
  11. print 'Me & Rob both like: %s' % ','.join(foods_in_common)
Add Comment
Please, Sign In to add comment