Can you tell how can I print the count in decreasing order ? In your example hello word comes twice, so first hello:2 should be printed, then other word's frequency.
You have Stored the frequency values in dictionary.. use dictionary.value() function and sort them afterward if you only want values from the dict. If you want the keys too. Then simply cast the dict to list and sort it using sorted function. I believe it will work.
this video actually helped me out instead of the other useless online tutorials, thanks a bunch!!
Glad to hear it!
THIS GUY RIGHT HERE SAVES LIVES!!!!!
Thanks a lot!!!
You're welcome! Please do subscribe to the channel if you like it.
Can you tell how can I print the count in decreasing order ? In your example hello word comes twice, so first hello:2 should be printed, then other word's frequency.
You have Stored the frequency values in dictionary.. use dictionary.value() function and sort them afterward if you only want values from the dict.
If you want the keys too. Then simply cast the dict to list and sort it using sorted function.
I believe it will work.
How to print as a string ??. Without using list.. I want to print this way hi2hello3how2... and so on..
Hi! Did you manage to find out?
Hi! Could you explain please where is 'i' coming from? Also, if you can, explain what {} means?
you are printing (d) but what is 'd'?
The i is a variable representing each word in the string. You can use any other word as the variable, as long as it is not a keyword, I believe.
{} is the empty dictionary