Python:Minumim Function
<p>I'm new to Python and I have a problem which needs to be solved with the min function in Python.</p>

<p>I have three ingredients which are:</p>

<pre><code>chicken = 20
lettuce = 30
tomato = 50
max_burgers = "Code Goes Here"
</code></pre>

<p>You need to make burgers with these. Each burger contains 1 piece of chicken, 3 lettuce leaves and 6 tomato slices. Using the min function, I need to calculate the maximum number of burgers which can be made with these ingredients. I've already done this with a while loop and the answer is 8. But I can not do so with a min function.</p>

<p>Any sort of help would be greatly appreciated.</p>

<p>Than You.</p>

<p>The <code>min</code> function takes an arbitrary amount of arguments and takes the lowest value:</p>

<pre><code>&gt;&gt;&gt; min(1, 2, 3,)
1
</code></pre>

<p>To solve this, simply calculate the max amount of burgers that could be made with each ingredient using floor division, and then pick the lowest amount:</p>

<pre><code>&gt;&gt;&gt; chicken, lettuce, tomato = 20, 30, 50
&gt;&gt;&gt; min(chicken, lettuce // 3, tomato // 6)
8
</code></pre>

python min