Python Forum
Fequency of letters with dictionary
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fequency of letters with dictionary
#2
now you have a dictionary with a count of letters.
create another empty dictionary.
create a for loop for key(old), value(old) of the dictionary you created
if the value(old) is a key in the new dictionary
append the key(old) to the key(new)
else
set the key(new) to a list with the value(old) inside.

it makes sense to me but might not to you basically you are flipping the key, & values between dictionary's and storing the values in a list.
Reply


Messages In This Thread
Fequency of letters with dictionary - by Jen_Sophia - Apr-09-2019, 04:15 PM
RE: Fequency of letters with dictionary - by Yoriz - Apr-09-2019, 07:54 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020