common folder

old-commit-hash: e8d888c45b
This commit is contained in:
George Hotz
2020-01-17 10:28:44 -08:00
parent cc60fedeba
commit b1f13418e1
57 changed files with 3840 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
def replace_right(s, old, new, occurrence):
# replace_right('1232425', '2', ' ', 1) -> '12324 5'
# replace_right('1232425', '2', ' ', 2) -> '123 4 5'
split = s.rsplit(old, occurrence)
return new.join(split)