What is correct way to convert Python dict in single string?
I have example program with code:
keywordsList = {u'roland.luethe1@gmail.com': 2, u'http://www.3ho.de/': 4, u'http://www.kundalini-yoga-zentrum-berlin.de/index.html': 1, u'ergo@ananda-pur.de': 3}
keywordsCount = sorted(keywordsList.items(),key=lambda(k,v):(v,k),reverse=True)
for words in keywordsCount:
print words[0], " - count: ", words[1]
so after I sort my items I get result like this:
http://www.3ho.de/ - count: 4
ergo@ananda-pur.de - count: 3
roland.luethe1@gmail.com - count: 2
http://www.kundalini-yoga-zentrum-berlin.de/index.html - count: 1
And my question is what is correct way to combine all dict stuff with cout in one single string that would look printed out something like:
'http://www.3ho.de/ : 4, ergo@ananda-pur.de : 3, roland.luethe1@gmail.com : 2, http://www.kundalini-yoga-zentrum-berlin.de/index.html : 1'
or something similar but in logic way?