Created
April 24, 2018 22:16
-
-
Save scizzorz/caa0f5a7c00c5a354e32ad86b8ced01f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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