Skip to content

Instantly share code, notes, and snippets.

@scizzorz
Created April 24, 2018 22:16
Show Gist options
  • Save scizzorz/caa0f5a7c00c5a354e32ad86b8ced01f to your computer and use it in GitHub Desktop.
Save scizzorz/caa0f5a7c00c5a354e32ad86b8ced01f to your computer and use it in GitHub Desktop.
good_value=True
for comp in [('SiO2', (30, 40)),
('NaCl', (20, 30)),
('O2', (50, 60)),
('C', (100, 120)),
('K', (13, 14))]:
if comp[1][0]>data[comp[0]] or comp[1][1]<data[comp[0]]:
good_value=False
if good_value:
print(data)
comps = [
('SiO2', (30, 40)),
('NaCl', (20, 30)),
('O2', (50, 60)),
('C', (100, 120)),
('K', (13, 14)),
]
for element, (low, high) in comps:
if not (low <= data[element] <= high):
break
else:
print(data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment