omega-rosetta
aien-dev/omega-rosetta
Brought by drakestapleton
omega-rosetta / tasks / string-comparison / oracle.py
| 1 | # Independent reference for "String comparison" (Python 3, standard library only). |
| 2 | # expected.txt is this program's stdout; omc never produced it. |
| 3 | yn = {True: "yes", False: "no"} |
| 4 | for a, b in [("alpha", "beta"), ("Hello", "hello"), ("abc", "abcd"), ("abcd", "abc")]: |
| 5 | print(f"{a} {b} eq={yn[a == b]} lt={yn[a < b]} gt={yn[a > b]} equal-ignoring-case={yn[a.lower() == b.lower()]}") |