Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- robs_favs = ['pizza', 'bacon cheeseburgers', 'cupcakes']
- foods_in_common = []
- f = open('myfoods.csv')
- for food in f.readlines():
- food = food.strip("\n").strip("\r") # stripping invisible returns and new lines
- if food in robs_favs:
- foods_in_common.append(food)
- print 'Me & Rob both like: %s' % ','.join(foods_in_common)
Add Comment
Please, Sign In to add comment