https://www.codecademy.com/courses/learn-python-3/projects/physics-class
Hi, just a quick question, I am currently doing the Learn Python 3 course on here. I managed to do exactly what the developer in the project walkthrough video done step by step, exactly the same apart from one part. From task 11 onwards during the get_work function, I done it slightly different but still got the same output. My question is was I wrong to do it this way?
My code:
train_mass = 22680
train_acceleration = 10
train_distance = 100
def get_force(mass, acceleration):
return mass * acceleration
def get_work(distance):
return get_force(train_mass, train_acceleration) * distance
train_work = get_work(train_distance)
print(“The GE train does " + str(train_work) + " Joules of work over " + str(train_distance) + " meters.”)
I just used the get_force() function within my function and still got the same.
It’s my first post on this forum, so apologies if I haven’t given the whole information or if you need any other info.