Question: My task:

Write a program that prompts for a list of numbers and at the end prints out both the maximum and minimum of the numbers. (and not suppose to use the min and max function)

eg. if i enter 4, 5, 7, done, it should print maximum as 7 and mininum as 4. 

```
Max = None
Min = None
while True:
    num = raw_input("Enter a number: ")
    if num == "done":
        break
    try:
        int(num)
    except:
        print "Invalid input"
        continue
    int(num)
    if Max is None or num > Max :
        maximum = num
    if Min is None or num < Min :
        minimum = num
print maximum, minimum

```

Number used: 4, 5, 7, done

Results: It prints 7 and 7 for both maximum and minimum

Answer: 
You are never setting Min and Max after their initialisation. At each pass through the loop, both are None, so you set `maximum` and `minimum` to the newly entered number.

To fix this, either change Max to maximum and Min to minimum, or the opposite: maximum to Max and minimum to Min.

You're also throwing away the result of `int(num)`, so your num variable is always a string. This means the algorithm is comparing strings and not the numbers. It won't break, per se, but it might not give you the results you expect (e.g. given 3 and 20 as inputs, your code will say that 20 is smaller than 3)
`int(num)` casts `num` to an integer, then throws it away. You need to save a reference to it.

```
num = int(num)

```