Fix excise to have no effect if s doesn't contain split marks.
This commit is contained in:
parent
3928922731
commit
4717ccf84e
1 changed files with 3 additions and 1 deletions
|
@ -67,7 +67,9 @@ def excise(s, mark_left, mark_right):
|
|||
excise('What a wonderful day [soundtrack].mp3', ' [', ']') ->
|
||||
returns 'What a wonderful day.mp3'
|
||||
'''
|
||||
return s.split(mark_left)[0] + s.split(mark_right)[-1]
|
||||
if mark_left in s and mark_right in s:
|
||||
return s.split(mark_left)[0] + s.split(mark_right)[-1]
|
||||
return s
|
||||
|
||||
def longest_length(li):
|
||||
longest = 0
|
||||
|
|
Loading…
Reference in a new issue