interplane.Get Omega
Read in your language

omega-rosetta

aien-dev/omega-rosetta

Brought by drakestapleton

branch main Branches Tags History

omega-rosetta / tasks / sort-three-variables / oracle.py

6 lines · 414 bytes Raw Blame History
1# Independent reference for "Sort three variables" (Python 3, standard library only).
2# expected.txt is this program's stdout; omc never produced it.
3for vals in ([77444, -12, 0], ['lions, tigers, and', 'bears, oh my!', '(from the "Wizard of OZ")']):
4 for x in (vals, sorted(vals, key=lambda s: s.encode() if isinstance(s, str) else s)):
5 for name, v in zip("xyz", x):
6 print(f"{name} = {v}")