Python list syntax help -


results=[key key, value in adictionary if str(key).startswith('target')      , value > 0 ] 

what trying here select keys if key in dictionary beginswith target , value greater 0. looks there's problem this, me~

results=[key key, value in adictionary.items() if str(key).startswith('target')               , value > 0 ] 

Comments

Popular posts from this blog

python - Why doesn't list have safe "get" method like dictionary? -

razor - Is this a bug in WebMatrix PageData? -

sql server - Stored procedure -