title: In Python, how to make operation on primitive types in a loop?
body: <p>I have the following code:</p>
  
  <pre><code>if isinstance(x0, float):
      x0 = int(round(x0))
  if isinstance(x1, float):
      x1 = int(round(x1))
  if isinstance(y0, float):
      y0 = int(round(y0))
  if isinstance(y1, float):
      y1 = int(round(y1))
  </code></pre>
  
  <p>How can I do it in a nice loop, without repeating the same code 4 times?</p>
  
  <p>I would maybe like something like this:</p>
  
  <pre><code>for x in (x0, y0, x1, y1):
      if isinstance(x, float):
          x = int(round(x))
  </code></pre>
  
  <p>Of course, this code does not work.</p>