omega-rosetta
aien-dev/omega-rosetta
Brought by drakestapleton
omega-rosetta / tasks / substring / oracle.py
| 1 | # Independent reference for "Substring" (Python 3, standard library only). |
| 2 | # expected.txt is this program's stdout; omc never produced it. |
| 3 | s = "abcdefgh" |
| 4 | n, m = 2, 3 |
| 5 | print(s[n:n + m]) |
| 6 | print(s[n:]) |
| 7 | print(s[:-1]) |
| 8 | print(s[s.index("d"):][:m]) |
| 9 | print(s[s.index("cd"):][:m]) |