From 5cfb944136f30421ac75f6d2db28a7a490bf6de4 Mon Sep 17 00:00:00 2001 From: David GAILLETON Date: Sat, 14 Mar 2026 15:34:04 +0100 Subject: [PATCH] mod 10 ex 1 WIP --- 10/ex1/higher_magic.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/10/ex1/higher_magic.py b/10/ex1/higher_magic.py index 3bbd423..f5323e3 100644 --- a/10/ex1/higher_magic.py +++ b/10/ex1/higher_magic.py @@ -44,6 +44,10 @@ def pow_2(nb: int) -> int: return nb * nb +def spell_transformer(spell: str) -> str: + return "* " + spell + " *" + + def main() -> None: try: print("=== spell_combiner ===") @@ -60,7 +64,15 @@ def main() -> None: print(f"Invalid: {caster(2, str)}") print("\n=== spell_sequence ===") - sequencer = spell_sequence([fireball, heal, isinstance]) + sequencer = spell_sequence( + [ + fireball, + heal, + spell_transformer, + ] + ) + print(f"Sequence result: {sequencer('dragon')}") + except Exception as err: print(err)