#!/usr/bin/python # TYPE:sciencemath # DESC:Converts your P, V, m, and T values to a friendly LaTeX representation of the ideal gas law equation. P = input("P: ") V = input("V: ") m = input("m: ") T = input("T: ") R = 8.31 M = (m*R*T)/(P*V) print "$$ \\frac{ "+str(m)+"g \\times 8.31\\frac{kPa \\times l}{mol \\times K} \\times "+str(T)+"K }{ "+str(P)+"kPa \\times "+str(V)+"dm^3 } = "+str(M)+"g/mol $$"