title: Python: Can anyone explain "f for f in..."
body: <p>can anyone explain in detail what this means? <code>f for f in...</code> for example</p>
  <pre><code>list = [f for f in os.listdir(os.getcwd()) if os.path.isdir(f)]
  print(list)
  </code></pre>
  <p>I understand the syntax of basic for loops, but I've seen this type of thing numerous times and I find it pretty confusing. I've been searching and all I can find is info on formatting. I just started in python around a month ago and am still learning. Thank you for any help!</p>