import re
def compare(a: int, b: int) -> str:
if a >= b and a != 0:
return f"match: {a} -> {b} | 50% & <test>"
return "no-match"
class Example:
def __init__(self):
self.mapping = {"a": [1, 2, 3], "b": None}
def run(self):
# Preserve: [] {} () <> <= >= != == := -> ...
pattern = r"^\s*#\s+\w+\s+\[.*\]\s+\{.*\}$"
return re.search(pattern, "# check [a] {b}") is not None
sample = """línea 1
línea 2 (4 espacios)
línea 3 (8 espacios)
\tlínea 4 (tabulador)
"""
print(compare(5, 3))
print(Example().run())
print(sample)