Python List count() Method

2018-08-22  本文已影响5人  孟轲666

Example

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

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

x = fruits.count("cherry")
上一篇下一篇

猜你喜欢

热点阅读