Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stuff = [{"value": 1}, {}, {}, {}, {}, {}]
- for d in stuff:
- if "value" in d:
- value = d["value"]
- if not value:
- value = 5
- print(value)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement