0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

python > string > split(",")の結果の個数を得る > cmds="set,mon,192.168.10.8,6000".split(",") してから count = len(cmds)

Last updated at Posted at 2015-11-13

pythonでsplit(",")した後に取得した要素数を得たい

参考 http://stackoverflow.com/questions/22101086/split-and-count-a-python-string

test.py
cmds="set,mon,192.168.10.8,6000".split(",")
count = len(cmds)
print count
結果
4
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?