Apr-03-2019, 04:46 PM
def foo(data): for value in data.values(): another_function(value)If you want only the keys, then use .keys().
If you want both, then use .items()
But first you should learn what a dict is.
Your examples are wrong. If the name
AB
,AD
,BD
exists, you get a set and not a dict with your first example. Your second dict is an SyntaxError.Don't use Python 2.7.x.
The support ends 2020 and even the library developers are stopping the support for Python 2.7
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
All humans together. We don't need politicians!