For Loops in Python (Output Smallest Input)
<p>Okay so I am practicing for loops in  Python and I was wondering how could I make a user input 10 intergers then it would output the smallest one. I would know how to do this with a while loop for example: </p>

<pre><code>Smallest = 0
count = 0
while count &lt; 10:
    Number = int(input("Enter a number &gt;&gt; "))
    if Number &lt; Smallest:
        Smallest = Number
    count = count + 1

print("{0} is the biggest value you have entered".format(Smallest))
</code></pre>

<p>But how do I do it in a for loop format? Here's what I have so far:</p>

<pre><code>for i in range(10):
    Number = int(input("Enter a Number &gt;&gt; "))
    if Number &lt; Smallest:
        Smallest = Number

print("{0} is the smallest value you have entered.".format(Smallest))
</code></pre>

<p>Since you are finding the Smallest values out of the input values from the user it is good practice to initially initialize the Smallest variable as maximum possible integer as below.</p>

<pre><code>import sys
Smallest = sys.maxint
</code></pre>

<p>Then the rest of your loop will work as properly as it is.</p>

python loops for-loop