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

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

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