Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- g = 9.8
- def get_distance(t):
- d = 0.5*g*(t**2)
- return d
- def get_times(d):
- t = ((2*d) / g) ** 0.5
- return t
- def distance_fallen(times: list):
- print('Time', ' | ', 'Distance fallen')
- for item in times:
- seconds = item*60
- distance = get_distance(seconds)
- print('{} sec | {} meters'.format(seconds, distance))
- def time_of_fall(distances: list):
- for item in distances:
- time = get_times(item * 1000)
- print('Distance: {} | Time taken: {} seconds'.format(item, time))
- T = [1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5]
- D = [2, 3.5, 4, 5.5, 6, 7.5]
- distance_fallen(T)
- time_of_fall(D)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement