Skip to content
murmot

Results for “python split method example program site:mail.python.org code”

  • mail.python.org

    [Tutor] input and raw input

    A string has a method split(); that may help you. > In your case, where you want either a space or a comma as a separator, it depends whether both can be used at the same time. If not, you can check for the occurrence of one or the other separator and run split() with the correct separator.

  • mail.python.org

    [Tutor] python 3.3 split method confusion

    But in the majority of cases split is used where we read a line > of input from a data file where the data fields are separated > by some arbitrary character, usually comma, tab or pipe. The > important bit is the data not the separator. > > > -- > Alan G > Author of the Learn to Program web site...

  • mail.python.org

    [Tutor] input and raw input

    A string has a method split(); that may help you. >If not, you can check for > the occurrence of one or the other separator and run split() with the > correct separator. If both can occur in the same line, you may want to use > the regex module instead: re.split() >.