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?

カンマ区切りの文字列の要素を数える方法

Posted at

説明

  1. split()を使って要素をリストに変換し、その長さをlen()で取得します。
code = "10,20,30,40,50"
count = len(code.split(","))
print(count)  # 5
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?