```python
return any(type in file_type for type in types) or filename.endswith("." + extension)
```

Check file type of file extension, only for reading sens as generally modern OS operate this way to find a type of file.

you can also replace output by file_type as it's more readable :)