title: Applying "%.1f" to multiple variables
body: <p>Just started a course and the exercise was to learn how to use <code>round(x, n)</code> to truncate <code>floats</code>.</p>
  
  <p>Only problem is, it didn't.  I found out about how to use <code>%.1f</code> online, but is there a way to apply it to multiple variables instead having to write it over and over?</p>
  
  <p>I have it set up like below:</p>
  
  <pre><code>a = float(input("a:"))
  b = float(input("b:"))
  c = float(input("c:"))
  d = float(input("d:"))
  e = float(input("e:"))
  
  sum = a + b + c + d + e
  average = sum/5
  
  print ("The sum of ", "%.1f" % (a), ", ", "%.1f" % (b), ",", "%.1f" % (c), ", ", "%.1f" % (d), ", and ", "%.1f" % (e), "is ", "%.1f" % (sum), ". Meanwhile, the average is ", "%.2f" % (average), ".")
  </code></pre>
  
  <p>Is there a way to apply the <code>%.1f</code> without having to write it so much?</p>
  
  <p>edit: thanks to everyone that helped out.  I found onur güngör's to have worked best with what I'm looking for, but I learned a lot more than what I needed from everyone's input.  appreciate it.</p>