Advertisement
Giftednarwhals

Untitled

Feb 22nd, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. #!/usr/bin/env python3
  2. from functools import *
  3. import json
  4.  
  5. with open("tweets.json", "r") as tweet_db:
  6.     tweets = json.load(tweet_db)
  7.  
  8. # TODO: implement assigned functions
  9.  
  10.  
  11. def flatten(xs):
  12.     return list(reduce(lambda res, x: res + (flatten(x) if isinstance(x, list) else [x]), xs, []))
  13.  
  14. #def difference(xs, ys)
  15.  
  16. #def to_text(tweets)
  17.  
  18. #def to_lowercase(tweets)
  19.  
  20. #def nonempty(tweets)
  21.  
  22. #def total_word_count(tweets)
  23.  
  24. #def hashtags(tweet)
  25.  
  26. #def mentions(tweet)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement