I try the solution that is already described here - it does not help. There is no more detailed error, because the robot is checking, and I do not see what it introduces. Here is the code:

# Даны длины сторон треугольника. Вычислите площадь треугольника # площадь по формуле Герона a = int(input()) b = int(input()) c = int(input()) p = (a + b + c) / 2 # полупериметр s = (p * (p - a) * (p - b) * (p - c)) if s < 0: s *= -1 print('{:.6f}'.format(pow(s, 0.5))) 

Tell me, please, what could be the error

  • And you, then, locally everything works? - Vladimir Martyanov
  • change / 2 -> / 2. otherwise it will work "correctly" only in Python 3 - MaxU
  • @MaxU, specified because the 3rd Python. Well, although the testing system may think differently - Kirill Malyshev
  • @ Kirill Malyshev, maybe the robot works under Python 2 - MaxU
  • That's what I think. Maybe you give the parties on a task through a space? - Kirill Malyshev

1 answer 1

If you read the input numbers in this way

 a = int(input()) 

they will be converted to type int . After all, the input() method returns a string, and int() tries to make an integer out of it. Accordingly, if you enter a number with a period, an error will occur. To read real numbers, you need to use the float() function:

 a = float(input())