common folder

This commit is contained in:
George Hotz
2020-01-17 10:28:44 -08:00
parent c4e5ce685e
commit e8d888c45b
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)