I have a little problem and I cannot understand why my program do this thing.
Can you help me?

I have a directory with a lot of different files.
I need a list of the ".TXT" files (yes, uppercase).

My code:

```
def listFile():
    files = [f for f in os.listdir('.') if os.path.isfile(f)]
    for f in files:
        if (f[-4:] != ".TXT"):
            del files[files.index(f)]

```

But I don't know why the list doesn't have only the ".TXT" elements.

My directory's elements:

```
['OrdinaFile0.3.py', 'OrdinaFile0.4-p2.py', 'OrdinaFile0.4-p3.py', 'OrdinaFile0.5-p2.py', 'OrdinaFile0.6-p2.py', 'TxtToXls-p2.py', 'aula1.TXT', 'testFiles.py', 'testxlwt.py']

```

The list produced by the code:

```
['OrdinaFile0.3.py', 'OrdinaFile0.4-p2.py', 'OrdinaFile0.6-p2.py', 'aula1.TXT']

```

Have you got any idea? Thanks.