Login and get codingWrite a function that accepts a string and splits the text on the specified separators, but only on the first occurrence of the delimiter.
For example:
>>> split_once('abc: def: ijk, lmno: pqr - stu, wxy', separators=',-:')
['abc', ' def: ijk', ' lmno: pqr ', ' stu, wxy']The separators parameter defaults to
None
if not supplied, in this case you should split on whitespace.
42 out of 51 users completed this Bite.
Will you be Pythonista #43 to crack this Bite?
Resolution time: ~65 min. (avg. submissions of 5-240 min.)
Pythonistas rate this Bite 5.0 on a 1-10 difficulty scale.
» Up for a challenge? 💪