🌿 Day 28 of My 90 Days Python Series — Advanced Mood Booster (OOP)
We all have rough days. Today’s project turns that feeling into something uplifting with a bit of code.
🧠 Why I Built This
I wanted something beyond simple scripts. Using Object-Oriented Programming, I created a mood-based message generator that’s clean, scalable, and interactive.
✨ Features
- Use preset moods like
happy
,sad
,tired
,anxious
and more - Dynamically add new moods and booster messages
- Modular code built with classes and methods
- No external libraries — pure Python
🧰 How It Works
- Instantiate the
MoodBooster
class - Display list of moods
- Ask the user for their mood (or command to add or exit)
- If mood exists, pick a random message and show it
- If “add”, collect new mood + messages and add it
- Continue until the user exits
python
# simplified flow
booster = MoodBooster()
booster.display_available_moods()
while True:
user_mood = input("How are you feeling? (or 'add'/'exit'): ").lower()
if user_mood == "exit":
break
elif user_mood == "add":
# code to get new mood + messages
booster.add_mood(new_mood, messages)
else:
msg = booster.get_message(user_mood)
print(msg or "Mood not found!")
[repo here:](https://github.com/shadowMomina/day-28-advanced-mood-booster.git)
Final Thoughts
Day 28 taught me how organizing code with classes makes it easier to extend and maintain.
If you’re learning Python, try converting one of your old scripts into OOP — you’ll see the difference.
Next up: Day 29 — something fresh and fun!
Top comments (0)