Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- time_units = {'с': 1, 'мин': 60, 'ч': 3600}
- distance_units = {'см': 0.001, 'м': 1, 'км': 1000}
- problem_type = input('Что нужно найти? ')
- if problem_type.lower() == 'расстояние' or problem_type.lower() == 'перемещение':
- print('Выберите тип движения:')
- print('1.Равномерное')
- print('2.Равноускоренное')
- type_of_movement = int(input())
- while type_of_movement not in range(1, 3):
- print('Попробуйте еще раз')
- print('Введите скорость с единицей измерения через пробел:')
- speed, speed_unit = input().split()
- speed_distance_unit, speed_time_unit = speed_unit.split('/')
- speed = speed * distance_units.get(speed_distance_unit) / time_units.get(speed_time_unit)
- print('Введите время с единицей измерения через пробел:')
- time, time_unit = int(input('t = '))
- time = time * time_units.get(time_unit)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement