Last active
February 26, 2020 16:08
-
-
Save MattOates/8011900f2d1cc99a49be500270b01a73 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
things = {"hi":10,"bye":3} | |
def flatten_counter(counter): | |
for value, count in counter.items(): | |
for i in range(count): | |
yield value | |
print(list(flatten_counter(things))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment