format='.mp4','.mkv' str='example.mp4' if str.ends

format='.mp4','.mkv' str='example.mp4' if str.endswith(format) print('this is a vedio file') 如何直接提取当前匹配的后缀呢?除了读取str外有其他办法不,有没有能直接知道format的方法