IF !hydratation THEN buy(Item.MUG_IFTTD)

Buy now

class IFTTD_Mug: def __init__(self): self.material = "ceramic" self.design = "colors_of_IFTTD_podcast" self.capacity = "350ml" # Ou toute autre capacité self.is_for = ["coffee_lovers", "tea_enthusiasts", "water_guzzlers"] def fill(self, liquid="coffee"): if liquid in ["coffee", "tea", "water"]: return f"Enjoying your {liquid}!" else: return "Perfect for any beverage!" def is_it_for_you(self, drinker_type): return drinker_type in self.is_for def purchase(self): print("Adding MUG_IFTTD to your collection...") print("Stay hydrated and happy coding!") # Usage: mug = IFTTD_Mug() current_hydration = False # True means you're hydrated, False means you're not. drinker = "coffee_lovers" # Or "tea_enthusiasts" or "water_guzzlers" if not current_hydration: if mug.is_it_for_you(drinker): mug.purchase() else: print(f"This mug is perfect for all, especially {drinker}!") else: print("Remember to refill soon!")

Derniers commits

Écouter le dernier épisode