I suggest using a tuple of acceptable formats and checking against that tuple (or make it a list if it's not going to be read-only).

```
accepted_formats = ('ogg', 'mpg', 'mpeg')
if ext in accepted_formats:
    # do stuff