game_world = { "player": { "name": "Player 1", "level": 1, "xp": 0, "inventory": { "sword": {"power": 10}, "armor": {"defense": 5}, }, }, "cheat_menu": { "health_points": {"description": "Add 100 health points"}, "max_health_points": {"description": "Set maximum health points to 500"}, "power_up": {"description": "Increase the power of your sword by 100"}, "power_down": {"description": "Decrease the power of your sword by 100"}, }, } def activate_cheat(cheat_name): player = game_world["player"] cheat_effect = game_world["cheat_menu"][cheat_name] if cheat_name == "health_points": player["hp"] += 100 elif cheat_name == "max_health_points": player["max_hp"] = 500 elif cheat_name == "power_up": player["inventory"]["sword"]["power"] += 100 elif cheat_name == "power_down": player["inventory"]["sword"]["power"] -= 100 print(f"Cheat '{cheat_name}' activated: {cheat_effect['description']}") # Test the function activate_cheat("health_points") activate_cheat("power_up")