Skip to content

PhysicsClass #116

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions PhysicsClass
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Uncomment this when you reach the "Use the Force" section

train_mass = 22680
train_acceleration = 10
train_distance = 100
bomb_mass = 1


# Write your code below:

def f_to_c(f_temp):
c_temp = (f_temp - 32) * (5 / 9)
return c_temp

f100_in_celsius = f_to_c(100)

# print(f_to_c(100))

def c_to_f(c_temp):
f_temp = c_temp * (9 / 5) + 32
return f_temp

c0_in_fahreinheit = c_to_f(0)

# print(c_to_f(0))

def get_force(mass, acceleration):
return mass * acceleration

train_force = get_force(train_mass, train_acceleration)
# print(train_force)
print(f"\nThe GE train supplies {train_force} Newtons of force.")

def get_energy(mass, c = 3*10**8):
return mass * c

bomb_energy = get_energy(bomb_mass)
print(f"\nA 1kg bomb supplies {bomb_energy} Joules")

def get_work(mass, acceleration, distance):
force = get_force(mass, acceleration) * distance
return force

train_work = get_work(train_mass, train_acceleration, train_distance)
print(f"\nThe GE train does {train_work} Joules of work over {train_distance} meters.")