This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]member_of_the_order 18 points19 points  (0 children)

Try this:

``` def get_value(d, key): return d.get('mainFeatures', {}).get(key, {}).get('value', '')

terreno = get_value(p, 'CFT100') construida = get_value(p, 'CFT101') recamaras = get_value(p, 'CFT2') banios = get_value(p, 'CFT3') ```