Advertisement
Guest User

Untitled

a guest
Jan 26th, 2020
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.05 KB | None | 0 0
  1. time_units = {'с': 1, 'мин': 60, 'ч': 3600}
  2. distance_units = {'см': 0.001, 'м': 1, 'км': 1000}
  3.  
  4.  
  5. problem_type = input('Что нужно найти? ')
  6. if problem_type.lower() == 'расстояние' or problem_type.lower() == 'перемещение':
  7.     print('Выберите тип движения:')
  8.     print('1.Равномерное')
  9.     print('2.Равноускоренное')
  10.     type_of_movement = int(input())
  11.     while type_of_movement not in range(1, 3):
  12.         print('Попробуйте еще раз')
  13.         print('Введите скорость с единицей измерения через пробел:')
  14.         speed, speed_unit = input().split()
  15.         speed_distance_unit, speed_time_unit = speed_unit.split('/')
  16.         speed = speed * distance_units.get(speed_distance_unit) / time_units.get(speed_time_unit)
  17.         print('Введите время с единицей измерения через пробел:')
  18.         time, time_unit = int(input('t = '))
  19.         time = time * time_units.get(time_unit)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement