Skip to content

Instantly share code, notes, and snippets.

@ashkantaravati
Created December 7, 2018 16:57
Show Gist options
  • Save ashkantaravati/e44964f45c0eb8269961455da2c78808 to your computer and use it in GitHub Desktop.
Save ashkantaravati/e44964f45c0eb8269961455da2c78808 to your computer and use it in GitHub Desktop.
python scripts I used for easing my calculations while writing lab report about Newton's 1st law.
cases = [
(0.4,0.49),
(0.5,0.60),
(0.6,0.73),
(0.7,0.85)
]
velocities = [(distance/duration) for (distance, duration) in cases]
rounded_velocities = [round(v,3) for v in velocities]
average_velocity = sum(rounded_velocities) / float(len(rounded_velocities))
rounded_average_velocity = round(average_velocity, 3)
delta_velocity = [v-rounded_average_velocity, 3) for v in rounded_velocities]
absolute_delta_velocity = [abs(v), for v in delta_velocity]
absolute_rounded_delta_velocity = [round(v,3), for v in absolute_delta_velocity]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment