Advertisement
Guest User

Untitled

a guest
Apr 15th, 2019
343
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. g = 9.8
  2.  
  3.  
  4. def get_distance(t):
  5. d = 0.5*g*(t**2)
  6. return d
  7.  
  8.  
  9. def get_times(d):
  10. t = ((2*d) / g) ** 0.5
  11. return t
  12.  
  13.  
  14. def distance_fallen(times: list):
  15. print('Time', ' | ', 'Distance fallen')
  16. for item in times:
  17. seconds = item*60
  18. distance = get_distance(seconds)
  19. print('{} sec | {} meters'.format(seconds, distance))
  20.  
  21.  
  22. def time_of_fall(distances: list):
  23. for item in distances:
  24. time = get_times(item * 1000)
  25. print('Distance: {} | Time taken: {} seconds'.format(item, time))
  26.  
  27.  
  28. T = [1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5]
  29. D = [2, 3.5, 4, 5.5, 6, 7.5]
  30.  
  31.  
  32. distance_fallen(T)
  33. time_of_fall(D)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement