title: condensing a loop and output into one statement
body: <p>I started out with a simple example to compare Python code to c#, my more usual language:</p>
  
  <pre><code>s=''
  for x in range(20,1,-3):
      print(x)
      s+="%d%s" % (x,":")
  print(s[:-1])
  </code></pre>
  
  <p>to simply output: 20:17:14:11:8:5:2</p>
  
  <p>then I thought about the shortest, not necessarily the most efficient way of doing it and came up with this after reading about list comprehension.</p>
  
  <pre><code>print(''.join([("%d%s" % (x,":")) for x in range(20,1,-3)])[:-1])
  </code></pre>
  
  <p>Is there an even shorter way? I know it's a trivial issue, but really it's about learning about all the features of Python and how it differs from other languages.</p>
  
  <p>thanks.</p>