The Hashtag Generator

Python

def generate_hashtag(s):
    capital_sentence = "".join(w.capitalize() for w in s.split())
    length = len(capital_sentence)
    if length == 0 or length > 140:
        return False

    return "#" + capital_sentence

Tags

  1. python (Private)
  2. 5-kyu (Private)
  3. codewars (Private)
  4. answer (Private)