fork download
  1. #U3RlcHVrb3Zh
  2. def calculate_function_value(x, a):
  3.  
  4. if x >= 0:
  5. return a
  6. else:
  7. return x
  8.  
  9. a_param = float(input("Введіть значення 'a': "))
  10. x_arg = float(input("Введіть значення 'x': "))
  11.  
  12.  
  13. y_result = calculate_function_value(x_arg, a_param)
  14.  
  15. print(f"Результат: y = {y_result}")
Success #stdin #stdout 0.08s 14012KB
stdin
7
11
stdout
Введіть значення 'a': Введіть значення 'x': Результат: y = 7.0