fork download
  1. def print_calculo(l, r):
  2. return ((l + (r - 1)) / 2, (l + (r - 1)) // 2)
  3.  
  4. print(print_calculo(5, 3)) # resultado de (l + (r - 1)) par
  5. print(print_calculo(5, 4)) # resultado de (l + (r - 1)) impar
Success #stdin #stdout 0.02s 27712KB
stdin
Standard input is empty
stdout
(3.5, 3)
(4.0, 4)