-2
イムをフロートするのpython:応答として、それは正しかった私のために...このコード提出
a = float(input())
b = float(input())
c = float(input())
if abs(b - c) < a < (b + c) and abs(a - c) < b < (a + c) and abs(a - b) < c < (a + b):
print("Perimetro = " + str(a + b + c))
else:
print("Area = " + str(((a + b) * c)/2))
とし、文字列を変換しますが、できなかった、私が手:私はいけない
Traceback (most recent call last):
File "Main.py", line 1, in <module>
a = float(input())
ValueError: could not convert string to float: '6.0 4.0 2.0'
Command exited with non-zero status (1)
それを取得する私はbeginginningで文字列を変換します。
私はここで間違っていますか?
ありがとうx
「6.0 4.0 2.0'」のように、数値に複数の小数点を付けることができます。文字列を分割して個別に処理する必要があります。 – sisanared