title: Function to count hashtags
body: <p>I'm trying to get a function that counts and shows hashtags of a list. </p>
  
  <p>Example input:</p>
  
  <pre><code>["Hey, im in the #pool",
   "beautiful #city",
   "#city is nice",
   "Have a nice #weekend",
   "#weekend &lt;3",
   "Nice #"]
  </code></pre>
  
  <p>Output: </p>
  
  <pre><code>{"pool" : 1, "city" : 2, "weekend" : 2}
  </code></pre>
  
  <p>But if there is only a <code>#</code> followed by no words, it should not count as a hashtag. 
  Same with stuff before the hashtag, something like „%#“ is not allowed to count as a hashtag.
  Hashtags are defined (a-z,A-Z,0-9) every other char ends the hashtag</p>
  
  <p>My current code:</p>
  
  <pre><code>def analyze(posts):
      tag = {}
      for sentence in posts:
          words = sentence.split(' ')
          for word in words:
              if word.startswith('#'):
                  if word[1:] in tag.keys():
                      tag[word[1:]] += 1
                  else:
                      tag[word[1:]] = 1
      return(tag)
  
  
  posts = ["Hey, im in the #pool",
           "beautiful #city",
           "#city is nice",
           "Have a nice #weekend",
           "#weekend &lt;3",
           "Nice #"]
  print(analyze(posts))
  </code></pre>