title: Write Numeric Manipulation in Python in 1 line
body: <p>i have a simple problem in Python where i need to return a value that is equal to floor if it is smaller than floor, and return ceiling if the value is larger than ceiling. I'm not sure if there is a simpler way to do so. What i will do is:</p>
  
  <pre><code>def floor_ceil(x):
      floor = 0
      ceil = 100
      if x &lt; floor:
         return floor
      elif x &gt; ceil:
         return ceil
      return x
  </code></pre>
  
  <p>Are there simpler ways to do so? The code looks clunky</p>