EasyPro challengePython

Adapter

PythonDesign PatternsStructural

Adapter wraps an incompatible interface so it matches the one your code
expects, without touching the original class.

LegacyPrinter.old_print(text) is what you have. Your code expects a
ModernPrinter-shaped .print_text(text). Implement
LegacyPrinterAdapter to bridge the two.

solve(texts) prints every text through the adapter and returns the results.

Sample tests

Test #1Single text
Input: [["Hello"]]
Output: ["LEGACY: Hello"]
Test #2Multiple texts
Input: [["A","B","C"]]
Output: ["LEGACY: A","LEGACY: B","LEGACY: C"]
Test #3Empty list
Input: [[]]
Output: []