Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Optional type (variable can also be None)

  • Optional
  • split
text = "a,b,c"

print(text.split())
print(text.split(None))
print(text.split(","))




def split(text, sep: str | None=None):
    return text.split(sep)

print(split(text))
print(split(text, None))
print(split(text, ","))