Apr-22-2020, 03:11 PM
Hi all!
Here I am new my first post :)
I have started learning python.
I have question is there better solution, than this:
Here I am new my first post :)
I have started learning python.
I have question is there better solution, than this:
ols = dict( clicks='Hits,Clicks,clicks' # define all possible clicks alternatives ) results = dict( Hits=2 ) # find the field name by how to search in the results clicks_col_name = [i for i in results if any(i == x for x in cols['clicks'].split(","))] clicks = results[clicks_col_name[0]] if len(clicks_col_name) > 0 else None print (clicks)