Python For Chemistry

 Instructions Home




 


















SELECTED PYTHON FOR CHEMISTRY

chemistry_word = "Atom"

print(chemistry_word)


integer = 2

print(integer)


float = 2.3

print(float)


percentage_composition = 75

print("Percentage Composition: %d" %(percentage_composition))


float = 4.56775

answer = round(float, 3)

print(answer)


number_one = 5

number_two = 7

add = number_one + number_two

print(add)


number_one = 5

number_two = 7

subtract = number_one - number_two

print(subtract)


number_one = 5

number_two = 7

divide = number_two / number_one

print(divide)


number_one = 5

number_two = 7

multiply = number_one * number_two

print(multiply)


number_one = 5

number_two = 7

power = number_one ** number_two

print(power)


mass_substance = 1.2

molar_mass_substance = 12.011

moles_substance = mass_substance / molar_mass_substance

print(moles_substance)


temp_celcius = 0

converter = 273.15

temp_kelvin = temp_celcius + converter

print(temp_kelvin)


pressure_atm = 3.00

moles = 5.30

R = 0.08206

temp_kelvin = 308.15

volume = (moles * R * temp_kelvin) / pressure_atm

print("Volume: %d" %(volume))


length_test_tube = 100

liquid_height = 87.2

difference = length_test_tube - liquid_height

print(difference)


import math

pi = math.pi

radius = 5

area_circle = pi * (radius**2)

print(area_circle)


measurements_in_L = [1.2, 3.4, 6.6, 7.8, 4.4]

for i in measurements_in_L:

    measurements_in_ml = i * 1000

    print(measurements_in_ml)


pressure = input()

print(pressure)


temperature_kelvin = 567.90

convert_integer = int(temperature_kelvin)

print(convert_integer)

pressure_integer = float(input())

print(pressure_integer)