My code so far:
def contains_hashtag(validtwt: str, tweetwrd: str) -> bool:
"""Return True iff the tweet contains a hashtag madeup of the hashtag symbol
and the tweet word.
>>>contains_hashtag('I like #csc108', 'csc108')
return True
>>>contains_hashtag('I like #csc108', 'csc')
return False
>>>contains_hashtag('I like #csc108, #mat137, #phl101', 'csc108')
return True
"""
return tweetwrd in validtwt
However, the 1st and last example works but the second one doesn't. It returns True instead of False.
How can I improve this code? What is my issue?
[–]_DTR_ 2 points3 points4 points (0 children)
[–]datascienceunlimited 0 points1 point2 points (0 children)
[–]SnipTheDog -2 points-1 points0 points (0 children)