def generate_fun_fact(): """Generate random fun facts to keep users engaged""" fun_facts = [ "Octopuses have three hearts! 💙", "Honey never spoils - archaeologists have found pots of honey in ancient Egyptian tombs that are over 3,000 years old and still perfectly good to eat.", "A group of flamingos is called a 'flamboyance'! �", "Bananas are berries, but strawberies aren't! �", "The shortest war in history lasted only 38 minutes! ⏱️" ] return random.choice(fun_facts) def calculate_progress(attempts): """Calculate user's progress based on number of attempts""" if attempts < 5: return "🌱 Beginner - Keep going!", elif attempts < 10: return "🌿 Intermediate - You're getting the hang of this!", elif attempts < 15: return "🌳 Advanced - You're persistent!", else: return "🌟 Master - Your determination is inspiring!" def create_encouragement(attempts, last_result): """Generate personalized encouragement based on user's journey""" encouragements = [ f"Attempt #{attempts}: Every expert was once a beginner.", f"Attempt #{attempts}: The harder you work for something, the greater you'll feel when you achieve it.", ] return random.choice(encouragements)