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
Go to list of users who liked
More than 5 years have passed since last update.
pythonでsplit(",")した後に取得した要素数を得たい
参考 http://stackoverflow.com/questions/22101086/split-and-count-a-python-string
cmds="set,mon,192.168.10.8,6000".split(",")
count = len(cmds)
print count
4
Register as a new user and use Qiita more conveniently
Go to list of users who liked