Python - Find longest (most words) key in dictionary -


is there way query dictionary object in order find key (all keys of string type) words?

i.e., if item largest key had 5 words {'this largest key': 3}, how query dict , have int '5' returned?

best, georgina

max of - count of words per key:

max(len(k.split()) k in d.keys()) 

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -