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 = """line 1
line 2 (4 spaces)
line 3 (8 spaces)
\tline 4 (tab)
"""
print(compare(5, 3))
print(Example().run())
print(sample)