title: How can I iterate through the keys of a dictionary based on condition?
body: <pre><code>dic = {'a': 1, 'b': 2, 'c': 3}
  
  def iteration(reg=None):
      for k in dic.keys():
          print('x')
  
  iteration(reg='a')
  iteration(reg='all')
  
  </code></pre>
  <p>I am trying to loop through the keys in a dictionary on two different conditions, one when the key is equal to a specific value and the other one is through all keys by denoting 'all' to the argument of the function.</p>
  <p>I can go through the first condition by using if k == 'a' (example) but not sure what to pass for the second condition</p>