Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- train_mass = 22680
- train_acceleration = 10
- train_distance = 100
- bomb_mass = 10
- def get_force (mass, acceleration):
- return mass * acceleration
- train_force = get_force (train_mass, train_acceleration)
- print ("The GE train supplies " + str(train_force) + " Newtons of force.")
- print ("")
- def get_energy (mass, c=3*10**8):
- return mass * c ** 2
- bomb_energy = get_energy (bomb_mass)
- print ("A " + str(bomb_mass) + "kg bomb supplies " + str(bomb_energy) + " Joules.")
- print ("")
- def get_work(mass, acceleration, distance):
- return mass * acceleration * distance
- train_work = get_work(train_mass, train_acceleration, train_distance)
- print ("The GE train does " + str(train_work) + " Joules of work over " + str(train_distance) + " meters.")
- print ("")
- print ("--------------------")
- print ("")
- #-----------------------------------------------#
- print ("Fahrenheit to celsius conversion:")
- def f_to_c(f_temp):
- c_temp = (f_temp - 32) * 5/9
- return c_temp
- f_var = 1000
- f100_in_celsius = f_to_c(f_var)
- print (str(f_var) + " degrees fahrenheit will convert to " + str(f100_in_celsius) + " degrees celsius.")
- #Titles and spacer.
- print ("")
- print ("Celsius to fahrenheit conversion:")
- def c_to_f(c_temp):
- f_temp = c_temp * (9/5) + 32
- return f_temp
- #Edit this value below ONLY. Everything else will fall in line.
- c_var = 38
- c0_in_fahrenheit = c_to_f(c_var)
- print (str(c_var) + " degrees celsius will convert to " + str(c0_in_fahrenheit) + " degrees fahrenheit.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement