Python unpacking operator to get list of dictionary keys from dict_keys
The *
operator works to get a list from dictionary keys!
my_dict.keys()
returns adict_keys
object.[*my_dict.keys()]
returns the keys as list of strlist(..)
would do the same but in a more readable way :)
Anyway filling this under “cool stuff I won’t ever use”
Nel mezzo del deserto posso dire tutto quello che voglio.
comments powered by Disqus