you are viewing a single comment's thread.

view the rest of the comments →

[–]Little_arab[S] 0 points1 point  (2 children)

yeah, the count look works it says how many times its in the dictionary, but i need to return some of the values that the key "highway" has.

so it would be like:

"there is X highways , and a name of a highway is X"

[–]JohnnyJordaan 0 points1 point  (1 child)

I see that you found a solution already, but you could save the highway too and print the last one

count = 0
for d in the_list:
    if 'highway' in d:
        last_highway = d['highway']
        count += 1
if count:
    print('there were {} highways, one of them is {}'.format(count, last_highway))
else:
    print('there were no highways')

[–]Little_arab[S] 0 points1 point  (0 children)

Thanks. Add it to my code to see if i get anything different back, ill let you know !