python: could not convert string to float
<p>im submitting this code..</p>

<pre><code>a = float(input())
b = float(input())
c = float(input())

if abs(b - c) &lt; a &lt; (b + c) and abs(a - c) &lt; b &lt; (a + c) and abs(a - b) &lt; c &lt; (a + b):
    print("Perimetro = " + str(a + b + c))
else:
    print("Area = " + str(((a + b) * c) / 2))
</code></pre>

<p>and for me it was correct, but, as a response, i get: </p>

<pre><code>Traceback (most recent call last):
  File "Main.py", line 1, in &lt;module&gt;
    a = float(input())
ValueError: could not convert string to float: '6.0 4.0 2.0'
Command exited with non-zero status (1)
</code></pre>

<p>which i dont get it cause i converted the strings in the begginning.</p>

<p>what am i doing wrong here?</p>

<p>thanks x</p>

<p>The issue is that you are entering all the three values at once. Add one value and then press enter. For example:</p>

<pre><code>&gt;&gt;&gt; a = float(input())
6.0
&gt;&gt;&gt; b = float(input())
4.0
&gt;&gt;&gt; c = float(input())
2.0
&gt;&gt;&gt; a, b, c
(6.0, 4.0, 2.0)
</code></pre>

<p>OR, get the single string and <code>split</code> the string to assign the value to <code>a</code>, <code>b</code> and <code>c</code>. For example:</p>

<pre><code>&gt;&gt;&gt; a, b, c = [float(item) for item in input().split()]
6.0 4.0 2.0
&gt;&gt;&gt; a, b, c
(6.0, 4.0, 2.0)
</code></pre>

python string input floating-point