Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #99913

Question about split method

Newsgroups comp.lang.python
Date 2015-12-02 12:37 -0800
Message-ID <169982db-7285-484a-9a48-0d4a2ea7dea1@googlegroups.com> (permalink)
Subject Question about split method
From Robert <rxjwg98@gmail.com>

Show all headers | View raw


Hi,

I learn split method online. When I try to run the line with ss1 beginning,
I don't understand why its output of ss1 and ss2. I have check the help
about split. It looks like that it is a numpy method.
What is the split method parameter (within "  ") for?


Thanks,



...............
ss0="1, 2, 4, 8, 16".split(", ")

ss0
Out[2]: ['1', '2', '4', '8', '16']

ss1="1, 2, 4, 8, 16".split("    , ")

ss1
Out[4]: ['1, 2, 4, 8, 16']

ss2="1, 2, 4, 8, 16".split(",   ")

ss2
Out[9]: ['1, 2, 4, 8, 16']

help(split)
Help on function split in module numpy.lib.shape_base:

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Question about split method Robert <rxjwg98@gmail.com> - 2015-12-02 12:37 -0800
  Re: Question about split method Ian Kelly <ian.g.kelly@gmail.com> - 2015-12-02 14:44 -0600
    Re: Question about split method Robert <rxjwg98@gmail.com> - 2015-12-02 13:00 -0800
    Re: Question about split method Peter Pearson <pkpearson@nowhere.invalid> - 2015-12-05 19:29 +0000
      Re: Question about split method Robert <rxjwg98@gmail.com> - 2015-12-05 11:51 -0800
        Re: Question about split method Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-12-05 20:27 +0000
        Re: Question about split method Erik <python@lucidity.plus.com> - 2015-12-05 22:20 +0000

csiph-web