def get_hashtag(tweet):
    """
    Get hashtag of a tweet.

    :tweet: string.
    :return: hashtag or empty string.
    """
    hashtag = ""
    idx_of_tag = tweet.rfind('#')
    if idx_of_tag is not -1:
        idx_of_tag_end = tweet.find(' ', idx_of_tag)
        if idx_of_tag_end is -1:  # hashtag is the last word
            hashtag = tweet[idx_of_tag:]
        else:
            hashtag = tweet[idx_of_tag:idx_of_tag_end]

    return hashtag