title: Unpack multiple floats from input()
body: <p>Here is what I need:
  The user to input 4 comma separated float values which I will use to create my my rectangle class.</p>
  <p>Here is my current approach:<br>
  <br>1)Get user input with input()<br>
  <br>2) Split() the input into lists<br>
  <br>3)Unpack it into variables<br>
  <br>4)Turn those variables (which are strings) into floats<br>
  <br>At this point I get an error because the commas have not been separated from the string values, so trying to convert into float gives a type error. I could get around this by making a for each loop go through every value individually and format it, but this is unnecessarily complex. My question is, how can I do this in a much cleaner, simpler way?</p>
  <pre><code>def main():
      
      x1,y1,width1,height1 = input(&quot;Enter x1, y1, width1, height1: &quot;).split()
      
      x1,y1,width1,height1 = float(x1),float(y1),float(width1),float(height1)
      
      r1 = Rectangle2D(x1,y1,width1,height1)
  
      x2,y2,width2,height2 = input(&quot;Enter x2, y2, width2, height2: &quot;).split()
      x2,y2,width2,height2 = float(x2),float(y2),float(width2),float(height2)
      r2 = Rectangle2D(x2,y2,width2,height2)
      
  class Rectangle2D:
  
      def __init__(self, x = 0.0, y = 0.0, width = 0.0, height = 0.0):
          self.x = x
          self.y = y
          self.width = width
          self.height = height
  </code></pre>
  <p>Sample run:</p>
  <pre><code>Enter x1, y1, width1, height1: 9, 1.3, 10, 35.3
  Traceback (most recent call last):
    File &quot;C:\Users\Lisa Dueker\Desktop\comp sci\week 9\HW\8.19.py&quot;, line 127, in &lt;module&gt;
      main()
    File &quot;C:\Users\Lisa Dueker\Desktop\comp sci\week 9\HW\8.19.py&quot;, line 4, in main
      x1,y1,width1,height1 = float(x1),float(y1),float(width1),float(height1)
  ValueError: could not convert string to float: '9,'
  </code></pre>