For my problem I have to write a min function that can take up to 4 numeric arguments but must have at least 2. The third and fourth arguments have to be set to None if they aren't passed a value. The function should return the smallest value of those passed and must work with either 2, 3, or 4 values.
This is what I have:

```
def min(num1, num2, num3=None, num4=None):
   if num1<num2:
     result=num1
   elif num2<num1:
     result=num2
   elif num3>None:
     if num3<num1 and num3<num2:
       result=num3
   else:
     min_num=num4
   return result

```

When I run it in python and enter 4 values, it doesn't return the minimum number. It just returns a random number from the four arguments I entered. Can anyone help me out?