I’ve completed the Getting Ready for Physics Class project but wanted some clarification on an aspect of the code.
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.’)
def get_energy(mass, c = 310**8):
return mass * cc
bomb_energy = get_energy(bomb_mass)
print(‘A 1kg bomb supplies ’ + str(bomb_energy) + ’ Joules.’)
def get_work (mass, acceleration, distance):
force = get_force(mass, acceleration)
return force * distance
For the function get_work why do I have to re-state the variables of mass and acceleration in the line “force = get_force(mass, acceleration)” if they’ve already been previously stated as part of the get_force function? If I left the variables blank would it not assume the defaults of (mass, acceleration)?