ynonp / python-examples-verint-2016-07

Python examples and exercises
MIT License
2 stars 35 forks source link

ToCode Solution: תרגול פונקציות #170

Closed HananRosenthal closed 8 years ago

szabgab commented 8 years ago

You already have the key in hand when you call k = f(word). Use that as the key in the dict.

HananRosenthal commented 8 years ago

yes, but still need to extract all words belonging to a specific key. How would you do that without another list comprehension?

szabgab commented 8 years ago

You go over the words one by one and on each turn you add the word to the list of the respective key. There is only one "loop" in this sentence.