title: How to add strings to a list in Python?
body: <p>I have a list of values that looks like this: </p>
  
  <pre><code>15,100,25.0
  -50,-50,50.0
  -20,120,70,40
  200,-100,25,5
  </code></pre>
  
  <p>The first two lines represent values for a circle, the third for a rectangle and the fourth for a polygon. I would like the output to look like this:</p>
  
  <pre><code>c 15,100,25.0
  c -50,-50,50.0
  r -20,120,70,40
  p 200,-100,25,5
  </code></pre>
  
  <p>I'm not sure how I can add the letter for each of the lines. I have a for-loop that I'm using to go through the information in the string to print them out.</p>
  
  <pre><code>for shapes in list_of_shapes:
      print(",".join(str(item) for item in shapes))
  </code></pre>
  
  <p>Here's some of my code:</p>
  
  <pre><code>list_of_shapes = []
  
  while p &gt;= 0:
  
      #Here is a bunch of code
  
      list_of_shapes.append("c")
      list_of_shapes.append(circle) # appends the data for the circles
  while p2 &gt;= 0:
      #bunch of code
      list_of_shapes.append("r")
      list_of_shapes.append(rect) # appends the data for the rectangle
  while p3 &gt;= 0:
      #code
      list_of_shapes.append("p")
      list_of_shapes.append(poly) # appends the data for the polygon
  
      return list_of_shapes
  </code></pre>
  
  <p>Once I do this for all of them, I end up getting:</p>
  
  <pre><code>c
  15,100,25.0
  c
  -50,-50,50.0
  r
  -20,120,70,40
  p
  200,-100,25,5
  </code></pre>
  
  <p>Any help would be greatly appreciated :)</p>