搜索
您的当前位置:首页正文

Python List count() Method

来源:二三娱乐

Example

Return the number of times the value "cherry" appears int the fruits list:

fruits = ['apple', 'banana', 'cherry']

x = fruits.count("cherry")
Top