# Exercise 1: classify magma by silica # Boundaries are the common textbook values (check): 45, 52, 63, 69 wt% SiO2. def rock_type(sio2): if sio2 < 45: return "ultramafic" if sio2 < 52: return "basalt" if sio2 < 63: return "andesite" if sio2 < 69: return "dacite" return "rhyolite" for s in (47, 50, 58, 66, 73, 40): print(s, rock_type(s)) # 47 basalt # 50 basalt # 58 andesite # 66 dacite # 73 rhyolite # 40 ultramafic # Which of these would you expect to be most explosive? The rhyolite (73): # it is the stickiest, so gas cannot escape easily.