Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- c_molar_mass = 12.01
- h_molar_mass = 1.01
- n_molar_mass = 14.01
- o_molar_mass = 16.00
- c = float(raw_input("Enter Carbon "))
- h = float(raw_input("Enter Hydrogen "))
- n = float(raw_input("Enter Nitrogen "))
- o = float(raw_input("Enter Oxygen "))
- print "C - " + str(c) + " / " + str(c_molar_mass) + "g/mol"
- print "H - " + str(h) + " / " + str(h_molar_mass) + "g/mol"
- print "N - " + str(n) + " / " + str(n_molar_mass) + "g/mol"
- print "O - " + str(o) + " / " + str(o_molar_mass) + "g/mol"
- print "= " + str(round(c / c_molar_mass, 2)) + " mols C"
- print "= " + str(round(h / h_molar_mass, 2)) + " mols H"
- print "= " + str(round(n / n_molar_mass, 2)) + " mols N"
- print "= " + str(round(o / o_molar_mass, 2)) + " mols O"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement