Question: I'm trying to get my code to go through and pop-out after some math has been done. The file being summed is just lists of numbers on separate lines. Could you give me some pointers to make this work because I am stumped.

**EDIT:**
I'm trying to get the transition from the main function to Checker function working correctly. I also need some help with slicing. The numbers being imported from the file are like this:

```
136895201785
155616717815
164615189165
100175288051
254871145153

```

So in my `Checker` funtion I want to add the odd numbers from left to right together. For example, for the first number, I would want to add `1`, `6`, `9`, `2`, `1`, and `8`.

Full Code:

```
def checker(line):

    flag == False
    odds = line[1 + 3+ 5+ 9+ 11]
    part2 = odds * 3
    evens = part2 + line[2 + 4 +6 +8 +10 +12]
    part3 = evens * mod10
    last = part3 - 10
    if last == line[-1]:
        return flag == True

def main():

    iven = input("what is the file name ")
    with open(iven) as f:
        for line in f:
            line = line.strip()
            if len(line) > 60:
                print("line is too long")
            elif len(line) < 10:
                print("line is too short")
            elif not line.isdigit():
                print("contains a non-digit")
            elif check(line) == False:
                print(line, "error")

```

Answer: 
`lambda args: expr` is not a special magic feature, it's just nice shorthand for

```
def someFunc(args):
    return expr

```

which is mainly useful when you need a small function with a simple expression for its body and you don't care about the name. If we used familiar syntax, the `closest()` method would be:

```
def closest(self,*points):
    def keyFunc(x):
        return float(x-self)           
    return min(points,key=keyFunc)

```

that is, it creates a small, one off function which does a little bit of calculation depending on `self` and its argument `x`, and passes that into the `min()` builtin function. As Ostrea explains, `min(seq, key=f)` returns the item *x* in `seq` which minimizes `f(`*x*`)`
Yes, `__sub__` and `__pow__` redefines `-` and `**` respectively. In this example you just pass anonymous function to optional argument for `min()`. Here is what this optional argument does, as said in [docs](https://docs.python.org/2.7/library/functions.html#min):

> 
> The optional keyword-only key argument specifies a one-argument ordering function like that used for list.sort().
> 
> 
> 

In this anonymous function you just subtract point, on which `closest` was called from points, which was passed as arguments and then convert it to float (this conversion is overridden, see `__float__`)