Advertisement
Guest User

Untitled

a guest
Jan 26th, 2020
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.83 KB | None | 0 0
  1. problem_type = input('Что нужно найти? ')
  2. if problem_type == 'расстояние' or problem_type == 'перемещение'\
  3.         or problem_type == 'Расстояние' or problem_type == 'Перемещение':
  4.     print('Выберите тип движения:')
  5.     print('1.Равномерное')
  6.     print('2.Равноускоренное')
  7.     type_of_movement = int(input())
  8.     while type_of_movement not in range(1, 3):
  9.         print('Попробуйте еще раз')
  10.         type_of_movement = int(input())
  11.     if type_of_movement == 1:
  12.         speed = int(input('V = '))
  13.         print('Выберите единицу измерения скорости:')
  14.         print('1.км/ч')
  15.         print('2.м/мин')
  16.         print('3.м/с')
  17.         print('4.см/с')
  18.         speed_unit = int(input())
  19.         while speed_unit not in range(1, 5):
  20.             print('Попробуйте еще раз')
  21.             speed_unit = int(input())
  22.         time = int(input('t = '))
  23.         print('Выберите единицу измерения времени')
  24.         print('1.часы')
  25.         print('2.минуты')
  26.         print('3.секуды')
  27.         time_unit = int(input())
  28.         while time_unit not in range(1, 4):
  29.             print('Попробуйте еще раз')
  30.             time_unit = int(input())
  31.         distance = speed * time
  32.         if speed_unit == 1 and time_unit == 1:
  33.             print(distance, 'км')
  34.         elif speed_unit == 2 and time_unit == 2:
  35.             print(distance, 'м')
  36.         elif speed_unit == 3 and time_unit == 3:
  37.             print(distance, 'м')
  38.         elif speed_unit == 4 and time_unit == 3:
  39.             print(distance, 'см')
  40.         else:
  41.             print('Программа не может это решить')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement