So i have a response from an api (openweathermap.org) and i have all the {weather} variables in a list. I am trying to get the most common in ["Sunny", "Scattered clouds", "Rainy", "Scattered Clouds"] Just an example but something like that.
I also thought of a way using for loops and dictionaries:
listt = ["R","S","SC","SC"]
dictt = {}
for i in listt:
dict[f"{i}"] +=1
But... Yeah. I know it would not work. I mean, i could hard code dictt
but i dont know all the weather conditions from the API.
Is there another way to get the most common String in a list?
i am using one-call api from openweathermap.org