Kodewick
Start learning →
Basic←→0 / 100

Make a hashtag

#036BasicStringsLoops4 min

You want a hashtag for your photo post. Write make_hashtag(phrase): start with #, then each word with a capital first letter and the rest lower case, no spaces. If there are no words at all, return "".

Examples
make_hashtag("summer beach day")→'#SummerBeachDay'
make_hashtag("I LOVE cats")→'#ILoveCats'
make_hashtag("")→''
main.py
def make_hashtag(phrase):
    words = phrase.split()
    # your code here: no words at all, return ""

    tag = "#"
    for word in words:
        # your code here: capital first, rest lower, add to tag
        pass
    return tag
Ctrl + Enter runs too
Result

Run tries the examples. When they look right, Submit.