I don't think my return statement passes all the test cases (the one with the empty string). The @FLOTUS is not a mention since a mention should proceed with a space or rather be the beginning of a tweet. So instead it should pass as an empty string. Any help would be appreciated on how to fix this!
def extract_mentions(tweet):
''' (str) -> list of str
Return a list containing all of the mentions in the tweet, in the order, they appear in the tweet.
Note: This definition of a mention doesn't allow for mentions embedded in other symbols.
Note: This definition of a mention doesn't allow for mentions embedded in other symbols.
>>> extract_mentions('@AndreaTantaros - You are a true journalistic professional. I so agree with what you say. Keep up the great work! #MakeAmericaGreatAgain')
['AndreaTantaros']
>>> extract_mentions('I'm joining @PhillyD tonight at 7:30 pm PDT / 10:30 pm EDT to provide commentary on tonight's #debate. Watch it here.')
['PhillyD']
>>> extract_mentions('Join me live in @Springfield, @ohio!')
['Springfield, ohio']
>>> extract_mentions('They endured beatings and jail time. They sacrificed their lives for this right@FLOTUS')
[''] '''
return [tag.strip('@') for tag in tweet.split() if tag.startswith('@')]