You can use in-built method count() to count the occurrences of a list item as shown in the below example –
1 2 3 4 5 |
l = ["aws","gcp","azure","aws","gcp","aws"] print(l.count("aws")) ## Returns 3 print(l.count("gcp")) ## Returns 2 print(l.count("azure")) ## Returns 1 |