📌  相关文章
📜  如何获取列表中的单词总数python代码示例

📅  最后修改于: 2022-03-11 14:46:00.970000             🧑  作者: Mango

代码示例1
#How to find total count of "BMW" cars from the list

car_list = ["BMW", "Audi", "BMW", "Mercedez", "BMW", "Ferrari"]

count = 0

for cars in car_list:
    if cars == "BMW":
        count = count + 1
print("Total BMW Cars in Garage are:-", count)