diff --git a/README.md b/README.md index d77fe73..2f8c8a8 100644 --- a/README.md +++ b/README.md @@ -35,5 +35,5 @@ Feel free to explore, learn, and share your own approaches. - [x] **3/27:** Infinite Monkey Theorem 🐒 - [x] **3/28:** 28 Days Later 🧟 - [x] **3/29:** Leaderboard Stats 📊 -- [x] **3/30:** Ye Old Emoticons 📰 +- [x] **3/30:** [Ye Old Emoticons](https://github.com/codedex-io/daily-challenges/tree/main/march-2026/3-30-ye-olde-emoticons) 📰 - [ ] **3/31:** ❓❓❓ diff --git a/march-2026/3-30-ye-olde-emoticons/ye-olde-emoticons.py b/march-2026/3-30-ye-olde-emoticons/ye-olde-emoticons.py new file mode 100644 index 0000000..d506d4b --- /dev/null +++ b/march-2026/3-30-ye-olde-emoticons/ye-olde-emoticons.py @@ -0,0 +1,16 @@ +def emoticons_mood(message): + # first let's define the emoticons + happy_emoticons = [":)", ":p", "xd", ":3", "<3", "\\m/"] + sad_emoticons = [":'(", ":(", "t(-.-t)"] + + # we init the score + score = 0 + + # now we calculate + for emoticon in sad_emoticons: + score -= message.lower().count(emoticon) + for emoticon in happy_emoticons: + score += message.lower().count(emoticon) + + # then we return the score + return score \ No newline at end of file